javascript - Textbox inside a button - Bootstrap twitter -


i want set textbox inside button. i'm having trouble click event of text box - whenever click textbox, clicks button , fires button's event. want separate 2 events - when i'll click textbox in order type, won't fire event that's connected button click. how can accomplish that?

edit: i've tried using stoppropagation , preventdeafult event of button fires before reaches event.

for requirement code work...

$('#btn').click(function(){ this.preventdefault();     alert("wont fire"); });  $('#txt').on('click',function(){     alert("text clicked"); }); 

demo take @ difference between , event here


Comments

Popular posts from this blog

Android layout hidden on keyboard show -

google app engine - 403 Forbidden POST - Flask WTForms -

c - Why would PK11_GenerateRandom() return an error -8023? -