[JS]getAttribute
Posted In:
IE_Firefox_相容
,
Javascript
.
By 卡西卡
可共用:
IE可用:
- obj.msg, obj['msg']
[SCRIPT]
function fnTest() {
var obj = document.getElementById('txtStr');
var msg = obj.getAttribute("msg");
print(obj.id+'='+obj.value+','+msg );
}
[/SCRIPT]
[BODY]
<form>
<input type="text" id="txtStr" value="123-Abc" msg="測試"
/>
<input type="button" id="btnSave" value="TEST"
onclick="fnTest();"/>
<br />
<div id="divMsg">divMsg</div>
</form>
[/BODY]
2 Responses to [JS]getAttribute
請問能否支援FIREFOX?
TO 樓上的
有支援FIREFOX
PS:本文tag為「IE_Firefox_相容」
Something to say?