WT 04
WT 04
4
Write a program to read and write HTML contents using JQuery
Title : Write a program to read and write HTML contents using JQuery
Aim : Write a Program using JQuery
Theory:
jQuery html() method is used to change the entire content of the selected elements. It replaces the selected
element content with new contents.It is a very useful function but works in a limited area because of its
API documentation. The API documentation of the jQuery html function consists of three method
signatures.
The first method signature has no argument, so it just returns the HTML within that element. The
remaining two signatures take a single argument: i.e. a string or a function that returns a string.
<head>
src = "https://ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js">
</script>
$(document).ready(function() {
$("p").css("background-color", "yellow");
});
</script>
</head>
<body>
<div>
</div>
</body>
</html>
This is a paragraph.
Conclusion: