Last active
January 19, 2018 00:22
-
-
Save kevinchisholm/d223e72b9135e5a675d14a030daf158b to your computer and use it in GitHub Desktop.
This file contains hidden or 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> | |
<meta charset="utf-8"> | |
<title>jQuery replaceWith() Example</title> | |
<script language="javascript" src="http://code.jquery.com/jquery-1.4.2.min.js"></script> | |
</head> | |
<script id="demo" type="text/javascript"> | |
$(document).ready(function() { | |
$("#foo").click(function(){ | |
$(this).replaceWith("<ul><li>one</li><li>two</li><li>three</li></ul>"); | |
}); | |
}); | |
</script> | |
<body> | |
<div id="foo">Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nulla at lectus erat.</div> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment