Ghost Answer Ghost Answer - 1 year ago 77
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.


Answer Source

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()"/>
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download