sushma_proach

radio show and hide button

May 27th, 2016
33
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.51 KB | None | 0 0
  1. <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
  2. <script>
  3. $( document ).ready(function() {
  4. $('input:radio[name="postage"]').change(function() {
  5.   if ($(this).val() == 'Yes') {
  6.     $('#watch').show();
  7.   } else {
  8.     $('#watch').hide();
  9.   }
  10. });
  11. });
  12. </script>
  13.  
  14. <label>
  15.   <input type="radio" id="postageyes" name="postage" value="Yes" />Yes</label>
  16. <label>
  17.   <input type="radio" id="postageno" name="postage" value="No" />No</label>
  18.   <input type="text" id="watch" />
Add Comment
Please, Sign In to add comment