Search code examples
javascriptjquerybuttonhiddenonkeyup

Make a jquery icon visible using on keyup event


Stumped at this part. I have a simple html input, and a jquery ui icon. What I want to do is have the icon hidden untill a "keyup" event of some sort is fired on the html input. Currently have the css property of the icon set to display:none;, but how would I use javascript to display this after some text is put into the html input?

--Here's my code

<input id="solo1" /> <div id="saveButton" class="ui-state-default ui-corner-all" title="Save" style="float:left; display:none; height:20px;" ><span class="ui-icon ui-icon-disk"></span></div>

Solution

  • Try something like below

    $("#solo1").keypress(function(){
        $("#saveButton").show();
    });