Javascript – How to display div after click the button in Javascript?

htmljavascript

I have following DIV . I want to display the DIV after button click .Now it is display none

<div  style="display:none;" class="answer_list" > WELCOME</div>
<input type="button" name="answer" >

Best Solution

HTML Code:

<div id="welcomeDiv"  style="display:none;" class="answer_list" > WELCOME</div>
<input type="button" name="answer" value="Show Div" onclick="showDiv()" />

Javascript:

function showDiv() {
   document.getElementById('welcomeDiv').style.display = "block";
}

See the Demo: http://jsfiddle.net/rathoreahsan/vzmnJ/