0% found this document useful (0 votes)
20 views2 pages

WT 04

experiment 4
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
20 views2 pages

WT 04

experiment 4
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

EXPERIMENT NO.

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.

This will produce following result −<html>

<head>

<title>The jQuery Example</title>

<script type = "text/javascript"

src = "https://ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js">

</script>

<script type = "text/javascript" language = "javascript">

$(document).ready(function() {

$("p").css("background-color", "yellow");

});

</script>

</head>

<body>
<div>

<p class = "myclass">This is a paragraph.</p>

<p id = "myid">This is second paragraph.</p>

<p>This is third paragraph.</p>

</div>

</body>

</html>
This is a paragraph.

This is second paragraph.

This is third paragraph.

Conclusion:

You might also like