html - Alert is not working on tags input bootstrap using jquery -


jquery alert not working tags input bootstrap input field. html:

<input type="text" name="cities"  class="form-control newcity" data-role="tagsinput" /> 

jquery:

$(document).on('keyup mouseup', ".newcity", function(e) {   e.preventdefault();   alert('hello');  }); 

i've tried keyup,mousedown,mouseup,mouseout nothing working.

js fiddle link : here

any suggestions, please!

because not doing in input.

your input hidden , bootstrap adding element in place of input.

inspect input can see this.

see demo: fiddle

$(document).on('keyup', ".bootstrap-tagsinput", function(e) { alert('hello');     e.preventdefault(); }); 

Comments

Popular posts from this blog

Is there a better way to structure post methods in Class Based Views -

performance - Why is XCHG reg, reg a 3 micro-op instruction on modern Intel architectures? -

jquery - Responsive Navbar with Sub Navbar -