What is DOM in jquery?

DOM (Document Object Model)

The <html> is the ancestor of all the other elements; in other words, all the other elements are descendants of <html>.

The <head> and <body> elements are not only descendants, but children of <html>, as well.

Likewise, in addition to being the ancestor of <head> and <body>, <html> is also their parent.

The <p> elements are children (and descendants) of <div>, descendants of <body> and <html>, and siblings of each other <p> elements.

File name : index.php

<html>
<head>
<title>The jQuery Example</title>
</head>

<body>
<div>
<p>This is a paragraph.</p>
<p>This is second paragraph.</p>
<p>This is third paragraph.</p>
</div>
</body>
</html>

$(document).ready(function() {
// this refers to window.document
});

$("div").click(function() {
// this refers to a div DOM element
});





Previous Next


Trending Tutorials




Review & Rating

0.0 / 5

0 Review

5
(0)

4
(0)

3
(0)

2
(0)

1
(0)

Write Review Here