javascript - Clear a property of element with jquery -


i'm designing basic form. have input text , button. when click button, if "input text" has no text inside, "x" icon appears inside in "input text".

i'm putting icon jquery. dont know how remove it. want clear icon when user clicks inside input text. here's jquery code.

$('#lbl1').click(function () {   if ($("#fill").val().length==0) {         $("#fill").css({ background: "url(image/cikis.png) no-repeat right"});   } });  $('#fill').click(function () {      //some codes here }); 

here html lines:

 <label id="lbl1">tıklama </label>  <input type="text" id="fill" /> 

$("#fill").click(function() {      $(this).css("background-image", "none"); }); 

Comments

Popular posts from this blog

c++ - Linked List error when inserting for the last time -

java - activate/deactivate sonar maven plugin by profile? -

java - What is the difference between String. and String.this. ? -