01.
<html>
02.
<head>
03.
<title>ThaiCreate.Com Ajax Tutorial</title>
04.
</head>
05.
<script language=
"JavaScript"
>
06.
function
fncDisabled()
07.
{
08.
document.getElementById(
'txt1'
).disabled =
true
;
09.
document.getElementById(
'chk11'
).disabled =
true
;
10.
document.getElementById(
'rdo1'
).disabled =
true
;
11.
}
12.
13.
function
fncEnabled()
14.
{
15.
document.getElementById(
'txt1'
).disabled =
false
;
16.
document.getElementById(
'chk11'
).disabled =
false
;
17.
document.getElementById(
'rdo1'
).disabled =
false
;
18.
}
19.
</script>
20.
<body>
21.
<input type=
"text"
name=
"txt1"
id=
"txt1"
value=
"my Text1"
>
22.
<input type=
"checkbox"
name=
"chk11"
id=
"chk11"
value=
"my Text2"
>
23.
<input type=
"radio"
name=
"rdo1"
id=
"rdo1"
value=
"my Text2"
>
24.
<br>
25.
<input name=
"btnDisabled"
id=
"btnDisabled"
type=
"button"
value=
"Disabled"
onClick=
"JavaScript:fncDisabled();"
>
26.
<input name=
"btnEnabled"
id=
"btnEnabled"
type=
"button"
value=
"Enabled"
onClick=
"JavaScript:fncEnabled();"
>
27.
</body>
28.
</html>