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/
It is shown, but you are submitting the page. Change your input to type=’button’ instead of ‘submit’