Advertisement
Guest User

Untitled

a guest
May 19th, 2019
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.59 KB | None | 0 0
  1. <script>
  2. (function () {
  3. 'use strict';
  4.  
  5. $('#monthly-2').change(function () {
  6. hideShowFormElements();
  7. });
  8.  
  9. $(document).ready(function () {
  10. hideShowFormElements();
  11. });
  12. })();
  13.  
  14. function hideShowFormElements() {
  15. var monthly = $('#monthly-2').is(':checked');
  16.  
  17. if(monthly) {
  18. $('#monthly').show();
  19. $('#yearly').hide();
  20. $('#monthly-2').prop('checked', false);
  21. }else{
  22. $('#yearly').show();
  23. $('#monthly').hide();
  24. $('#monthly-2').prop('checked', true);
  25. $('#yearly-2').prop('checked', false);
  26. }
  27. }
  28. </script>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement