The html() method is used to return the content of a particular elements and it returns the content of first matched element. It overwrites the content of matched elements.
<!DOCTYPE html>
<html>
<head>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.0/jquery.min.js"></script>
<script>
$(document).ready(function(){
$("button").click(function(){
$("p").html("Hello <b>evon Tech!</b>");
});
});
</script>
</head>
<body>
<button>Life is more beautiful than you</button>
<p>This is a paragraph.</p>
<p>Evon Tech Dehradun.</p>
</body>
</html>
0 Comment(s)