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"); });
Comments
Post a Comment