<html>
<head>
<title>自定義屬性</title>
<script language="javascript">
function showText()
{
alert(document.getElementById("txtInput").value);
}
function showValue()
{
alert(document.getElementById("txtInput").attributes["idvalue"].nodeValue);
}
</script>
</head>
<body>
<input type="text" id="txtInput" name="txtInput" value="自定義文本" idvalue="自定義值">
<input type="button" id="btnShowText" name="btnShowText" value="顯示文本內容" οnclick="showText();">
<input type="button" id="btnShowValue" name="btnShowValue" value="顯示文本值" οnclick="showValue();">
</body>
</html>