Removes all child nodes (including text nodes) from all paragraphs : Paragraph « jQuery « JavaScript DHTML
- JavaScript DHTML
- jQuery
- Paragraph
Removes all child nodes (including text nodes) from all paragraphs
<html>
<head>
<script type="text/javascript" src="js/jquery-1.3.2.js"></script>
<script type="text/javascript">
$(document).ready(function(){
$("p").click(function () {
$(this).empty();
});
});
</script>
</head>
<body>
<body>
<p>World</p>
<div>Replaced!</div>
</body>
</html>
Related examples in the same category