Q:

Hide all headings on a page when they are clicked using jquery

0

Hide all headings on a page when they are clicked. using jquery

All Answers

need an explanation for this answer? contact us directly to get an explanation for this answer

HTML Code :

<!DOCTYPE html>
<html>
<head>
<script src="//code.jquery.com/jquery-1.11.1.min.js"></script>
  <meta charset="utf-8">
  <title>Hide all headings  on a page when they are clicked</title>
</head>
<body>
<h1>Heading-1</h1>
<h2>Heading-2</h2>
<h3>Heading-3</h3>
</body>
</html>

JavaScript Code :

$("h1,h2,h3" ).click(function() {
  $( this ).slideUp();
});

need an explanation for this answer? contact us directly to get an explanation for this answer

total answers (1)

Similar questions


need a help?


find thousands of online teachers now