jquery slide toggle

The .slideToggle() method animates the height of the matched elements. This causes lower parts of the page to slide up or down, appearing to reveal or conceal the items. If the element is initially displayed, it will be hidden; if hidden, it will be shown. The display property is saved and restored as needed. If an element has a display value of inline, then is hidden and shown, it will once again be displayed inline. When the height reaches 0 after a hiding animation, the display style property is set to none to ensure that the element no longer affects the layout of the page.




<!DOCTYPE html>
	$(document).ready(function() {
		$("p").hide(); // by default <p> is hide on document load
		$("a").click(function() { //  on click <a> (anchor tag) event will be fired
			$("p").slideToggle(); // to toggle element <p>
	<div>Will my laptop get heavier if I put more file in it ?</div>
	<p>Yes, studies had shown that as data increases the laptop gets
		heavier and bigger, some peoples also got injured because laptop
		bursts. lol...</p>
	<a href="#">Show Answer</a>