jQuery if statement with .is


/ Published in: JavaScript
Save to your folder(s)



Copy this code and paste it in your HTML
  1. if ($('section:nth(1) p').is(':visible')) {
  2. $(this).html('Hide');
  3. }
  4. else
  5. {
  6. $(this).html('Show');
  7. }

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.