<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>