Created
November 26, 2013 22:15
-
-
Save zhangsida/7667299 to your computer and use it in GitHub Desktop.
switch between two <P>-element with jquery and css
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="http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"> | |
</script> | |
<script> | |
$(document).ready(function(){ | |
$("button").click(function(){ | |
$("p").toggle(); | |
}); | |
}); | |
</script> | |
</head> | |
<body> | |
<button>Toggle</button> | |
<p style="display:none">This is a paragraph with little content.</p> | |
<p>This is another small paragraph.</p> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Zeile 17: style="display:none" the point of this snippet