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 -

Qt QGraphicsScene is not accessable from QGraphicsView (on Qt 5.6.1) -

What is happening when Matlab is starting a "parallel pool"? -