javascript - Div not showing on click -


i having trouble displaying div on click using jquery. code looks correct me. on website have searchbar trying add search suggestions to. default hidden. if user selects "show suggestions", appear. form action being empty irrelevent. not work if remove form together. not getting errors. have been trying fix problem on hour, appreciate this.

html

<form action="">     <input type="text" id="txt1" onkeyup="showhint(this.value)" />     <input type="submit"  value="search" /><button id="hint"/>show suggestions </button> </form>  <div id="searchhint" style="display:none; border:1px solid red; width:300px;" > suggestions:<span id="txthint"></span></font></div>  

jquery

$(document).ready(function(){   $("#hint").click(function(){     $("#searchhint").show();   }); }); 

your html malformed, close "font" tag never open within #searchhint div. font tag depreciated anyway, should avoid using it.


Comments

Popular posts from this blog

django - How can I change user group without delete record -

java - Need to add SOAP security token -

java - EclipseLink JPA Object is not a known entity type -