I'm not too familiar with javascript, could anyone tell me what I'm doing wrong here?
Now what I want to happen is the value "test" to be passed to the hidden form like this:
However, what I actually get is this:
Any ideas as to what I'm doing wrong?
Thanks for any help.
HTML:
<html>
<head>
<script type="text/javascript">
function changeLink()
{
document.getElementById('lat').innerHTML="test";
}
</script>
</head>
<body>
<p>
<input type="button" onclick="changeLink()" value="Change link">
</p>
<form id="form" method="post">
<input name="lat" type="hidden" id="lat">
</form>
</body>
</html>
HTML:
<form id="form" method="post">
<input name="lat" id="lat" type="hidden" value="test">
</form>
HTML:
<form id="form" method="post">
<input name="lat" id="lat" type="hidden"><input>test
</form>
Thanks for any help.