Ghost Answer Ghost Answer - 3 months ago 15
Javascript Question

javascript button show/hide on text changed

I want to show and hide a button by using java script.

My problem is that the button should be hide on page load and when I changed the text in text box then button should be show.



pls, Check this page and tell if this is what you wanted.

Basically, you need to use onchange event to do whatever you want to do.


function showButton(){
<input type="button" id="button" value="New Button"/>
Change the text in Input Box. Then Button will be show<br/><br/>
<input type="text" id="userText" value="Change the text" onchange="showButton()"/>