Why does the following Javascript/form not work?
Posted
by
joshim5
on Stack Overflow
See other posts from Stack Overflow
or by joshim5
Published on 2011-01-09T05:43:12Z
Indexed on
2011/01/09
5:53 UTC
Read the original article
Hit count: 239
<form>
<input type="text" id="inputbox" value="hello"/>
<input type="submit" value="Convert" onClick="convert(document.getElementById("inputbox"))"/>
</form>
<script type="text/javascript">
function convert (text) {
alert(text);
return text;
</script>
This also does not work when I change alert to document.write. I obviously have more HTML to go along with this.
Thanks!
© Stack Overflow or respective owner