106
rated 0 times
[
111]
[
5]
/ answers: 1 / hits: 19305
/ 13 Years ago, fri, november 18, 2011, 12:00:00
I want to display id=text
when the button is clicked. So I tried this:
<form name=i_choose_form action= method=post>
<input type=submit class=button value=I am not sure, show me other choices... onclick = showText()></br>
</form>
<span id =text style=display:none>First make your choice then you can see all other choices</span>
<script type = text/javascript>
function showText() { document.getElementById(text).style.display=inline; }
</script>
But this does not work as expected and text is not displayed. What am I doing wrong? http://jsfiddle.net/dPhUQ/
More From » javascript