Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
<script type="text/javascript">
$(document).ready(function () {
$("#showHideBasicFunctions").click(function () {
$("#basicFunctions").hide();
});
$("p").click(function () {
$(this).hide();
});
$("#h3element").click(function () {
$(this).hide();
});
$(".someClass").click(function () {
$(this).hide();
});
$("#doubleClickMe").dblclick(function () {
$(this).hide();
});
$("#mouseEnterLeaveOnMe").mouseenter(function () {
$(this).hide();
});
$("#mouseEnterLeaveOnMe").mouseleave(function () {
$(this).show();
});
$("#hoverOnMe").hover(function () {
alert("You entered me! :O");
},
function () {
alert("And now you left me! :(");
});
});
</script>
<h2>Test1</h2>
<div>
<span><button id="showHideBasicFunctions">Show/Hide Basic Functions</button></span>
</div>
<div id="#basicFunctions">
<h3>Click these paragraphs to hide them!!</h3>
<p>Hello World!</p>
<p>Hello World again!!!</p>
<p>Hello World!</p>
<p>Hello World!</p>
<h3 id="h3element">I am selected by ID!</h3>
<h3 class="someClass">And I am selected by Class!</h3>
<h3 id="doubleClickMe">You need to double-click me!</h3>
<h3 id="mouseEnterLeaveOnMe">You need to hover on me with the mouse to hide me!</h3>
<h3 id="hoverOnMe">Hover on me to show some messages!</h3>
</div>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment