How to clear div append results formed during Jquery Autocomplete -


i using jquery auto complete our application .

the issue facing results captured during auto complete aren't being cleared . (the data being added div cleardiv)

when tried clear manually on click of button ,, auto complete functionality isn't working .

<input type='text' title='tags' id='tags' /> <div class="autosearch_result_wrap" id="tags_result"></div> <input type="button" id="cleardiv" value="clear" name="clear"><br>   $(document).ready(function() {     var atags = ["ask","always", "all", "alright", "one", "foo", "blackberry", "tweet","force9", "westerners", "sport"];     $( "#tags" ).autocomplete({         source: atags ,         minlength: 2,         appendto: "#tags_result",     });     $(document).on('click', '#cleardiv', function(event) {     $('#tags_result').empty();      });         }); 

could please let me know how resolve ??

http://jsfiddle.net/9r4cv/314/

i using chrome , tags clear leave textbox. browser using?

try test

$('#cleardiv').on('click', function(event) {     $('#tags').blur();          });     

http://jsfiddle.net/9r4cv/315/


Comments

Popular posts from this blog

php - failed to open stream: HTTP request failed! HTTP/1.0 400 Bad Request -

java - How to filter a backspace keyboard input -

java - Show Soft Keyboard when EditText Appears -