1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
| <html>
<head>
<script>
function load(id) {
var aInput=document.getElementById(id);
aInput.setAttribute('accessKey', aInput.getAttribute("title"));
aInput.style.backgroundColor="lightblue";
}
setTimeout("load('setTimeout');", 2000);
</script>
</head>
<body onload="load('onload')">
<input type="text" value="1 by JS onload" id="onload" title="1" />
<input type="text" value="2 by JS setTimeout" id="setTimeout" title="2"/>
<input type="text" value="3 by JS endBody" id="endBody" title="3"/>
<input type="text" value="4 natif" accesskey="4" title="4"/>
<script>
load("endBody");
</script>
</body>
</html> |