Created
March 11, 2019 09:36
-
-
Save asathoor/4fd4c121e747cff9583e0948ce3350ea to your computer and use it in GitHub Desktop.
jquery y-class
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script> | |
<script> | |
$(document).ready(function(){ // dom load check | |
// hat click detector | |
$("#hat").click(function(){ | |
$('#evilla').toggle(); | |
$('.star').toggle(); | |
}); | |
// my code ends | |
}); // document ready ends | |
</script> | |
</head> | |
<body> | |
<h2>One dark evening</h2> | |
<p>Transparent clouds pass the moon. Werewolves are howling</p> | |
<p>Just another manic monday.</p> | |
<img id="evilla" src="images/witch.png" alt="Evilla the evil bitch"> | |
<img class="star" src="images/star.png" alt="star"> | |
<img class="star" src="images/star.png" alt="star"> | |
<img class="star" src="images/star.png" alt="star"> | |
<img class="star" src="images/star.png" alt="star"> | |
<img class="star" src="images/star.png" alt="star"> | |
<img id="hat" src="images/hat.png" alt="hat"> | |
<button>Click me to hide paragraphs</button> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment