netscape4.76中使用IE支持的disable元素_IE支持的html元素的disable在netscape4.76中的实现
点击次数: 次 发布时间:2013-2-17
最后我附上一个例子,这个例子在IE6.0和Netscape4.76下测试通过!
<html>
<body>
<form>
<br>Test:<input type="text" name="t1" onfocus="disableText(this)">
<br>Edit:<input type="edit" name="t2" onfocus="disableEdit(this)">
<br>Textarea:<textarea name="t3" onfocus="disableTextarea(this)"></textarea>
<br>Password: <input type="password" name="t4" onfocus="disablePassword(this)">
<br>Radiobutton: <input type="radio" name="t5" onmousedown="return disableRadio(this)">
<br>Checkbox: <input type="checkbox" name="t6" onclick="return disableCheck(this)">
<br>Defaul disabled Checkbox: <input type="checkbox" disabled name="t8" onmousedown="return disableCheck2(this)">
<br>Select:
<select name="t7" onchange=" ChangeSelect(this)">
<option> one
<option> two
<option> three
<option> four
</select>
<br><input type="button" value="Enable/Disable" onClick="change()">
</form>
</body>
</html>
<script language="javaScript">
function disableText(obj)
{
if(obj.disabled)
obj.blur();
}
function disableEdit(obj)
{
if(obj.disabled)
obj.blur();
}
function disablePassword(obj)
{
if(obj.disabled)
obj.blur();
}
function disableTextarea(obj)
{
if(obj.disabled)
obj.blur();
}
function disableRadio(obj)
{
if(obj.disabled)
{
obj.checked=false;
return false;
}
}
function disableCheck(obj)
{
if(obj.disabled)
{
obj.checked=false;
return false;
}