버튼을 클릭하면 id="text"
을 표시하고 싶습니다. 그래서 이것을 시도 :버튼을 클릭 할 때 style.display를 none에서 inline으로 변경하려면 어떻게해야합니까?
<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>
그러나 이것은 예상대로 작동하지 않으며 텍스트가 표시되지 않습니다. 내가 도대체 뭘 잘못하고있는 겁니까? 양식이 원하는 결과를 방해처럼 http://jsfiddle.net/dPhUQ/
감사합니다. Pointy의 대답으로 jfiddle 설정을 변경했습니다. – Zeynel