javascript - Dynamically show text depending on form result -


i've got simple form, looks this:

team 1 <input type='button' value='-' class='qtyminus' field='quantity' /> <input type='text' name='quantity' value='0' class='qty' readonly /> <input type='button' value='+' class='qtyplus' field='quantity' />  team 2 <input type='button' value='-' class='qtyminus' field='quantity2' /> <input type='text' name='quantity2' value='0' class='qty' readonly /> <input type='button' value='+' class='qtyplus' field='quantity2' /> 

enter image description here

when 1 of teams has set number 3 want appear team's name dynamically below. "team1/team 2 winner!". , when change number next name of team, want text "team1/team2 winner!" disappear.

$('.qty').on('change', function(){   if($(this).val() == 3){     //   }   else {     // other thing   } }) 

Comments

Popular posts from this blog

jquery - How do you format the date used in the popover widget title of FullCalendar? -

asp.net mvc - SSO between MVCForum and Umbraco7 -

Python Tkinter keyboard using bind -