HTML DOM id 屬性
定義和用法
id 屬性可設(shè)置或返回隱藏輸入域的 id。
語(yǔ)法
hiddenObject.id=id
實(shí)例
下面的例子可取得隱藏輸入域的 id:
<html>
<body>
<form>
<input type="hidden" id="hidden1" />
</form>
<p>The id of the hidden field is:
<script type="text/javascript">
x=document.getElementById('hidden1');
document.write(x.id
);
</script></p>
</body>
</html>