HOME

Monday, November 23, 2015

JQUERY TO HIDE TEXT WHEN CLICK ON BUTTON AND TO SHOW WHEN DOUBLE CLICK ON BUTTON

<html>
<head>
<script src="jquery-2.1.4.min.js"></script>
<script>
$(document).ready(function()
{
$("#id1").click(function()
{
$(".class1").hide();
});
$("#id2").click(function()
{
$(".class2").hide();
});
$("#id3").click(function()
{
$(".class3").hide();
});
$("#id3").dblclick(function()
{
$(".class3").show();
});
$("#id2").dblclick(function()
{
$(".class2").show();
});
$("#id1").dblclick(function()
{
$(".class1").show();
});
});
</script>
</head>
<body>
<h1 class="class1">Click frist button to hide me</h1><br>
<h2 class="class2">click second button to hide me</h2><br>
<h3 class="class3">click third button to hide me</h3><br>
<button id="id1">First</button>
<button id="id2">Second</button>
<button id="id3">Third</button>
</body>
</html>

No comments:

Post a Comment