Home >Web Front-end >JS Tutorial >jQuery study notes[1] DOM operations in jQuery_jquery

jQuery study notes[1] DOM operations in jQuery_jquery

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOriginal
2016-05-16 18:14:581202browse

DOM is divided into three aspects, namely DOM Core, HTML-DOM, and CSS-DOM.
1. DOM Core is not exclusive to JavaScript. Any programming language that supports DOM can use it.
GetElementById(), getElementsByTagName()... and other methods in JavaScript.
For example: Use DOM Core to get the form object:
document.getElementsByTagName("form");
2, HTML-DOM.
When using JavaScript and DOM to write scripts for HTML files. There are many attributes specific to HTML-DOM. The emergence of HTML-DOM is even more important than DOM Core. Early on, it provides some more concise notations to describe the attributes of various HTML elements.
For example: Use HTML-DOM to get the form object method:
document.forms //HTML-DOM provides a forms Object.
3, CSS-DOM
CSS-DOM is an operation for CSS. The main function of CSS-DOM technology in JavaScript is to obtain and set various attributes of the style object.
For example: How to set the font color of an element's style object: element.style.color="red";
What you will learn below is: DOM operations in jQuery:
First build a DOM tree:

Copy code The code is as follows:

org/1999/xhtml">





What is your favorite fruit? ?



  • Apple

  • Orange
  • pineapple





The next operations are all centered around this DOM tree.
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn