I
ilovesss2004
Hi,
Here is my code:
<html>
<head>
<script>
var a="hello"
</script>
</head>
<body>
<input type="button" value="click" id=a onclick="alert(id)" />
</body>
</html>
But when I click the button. It shows "a" instead of "hello". I want
to store some information to the id of a button by a function, and the
function must be in the head section, not body section. Can someone
tell me how to do this?
Thanks alot.
Here is my code:
<html>
<head>
<script>
var a="hello"
</script>
</head>
<body>
<input type="button" value="click" id=a onclick="alert(id)" />
</body>
</html>
But when I click the button. It shows "a" instead of "hello". I want
to store some information to the id of a button by a function, and the
function must be in the head section, not body section. Can someone
tell me how to do this?
Thanks alot.