DOM operations in jQuery Development 5. dom development in jquery
CSS-DOM operation
The CSS-DOM technique is simply to read and set various attributes of a style object. In jQuery, you
This refers to the native JS Dom object. CSS (""): Write only one value is value, write two values is assignmentWindow.onload = = = $ (document). Ready ();$ (""): Gets the element tag name,. Class name, #idJQuery features
Chained programming
Jq.shou (in). HTML (content)
Equivalent
Jq.shou (3000)
jq.gtml (content)
Implicit iteration
Implicit pract
Use jQuery to operate DOM and jquery to operate dom
I. DOM operations are divided into three categories
1. DOM Core
DOM Core is not a specialized product of Javascript. It can be used b
The jQuery operation gets the DOM element, and jQuery operates the DOM element.
JQuery provides some functions and usage methods for DOM operations. Here, we will briefly describe how to use D
the first array: $.merge ([0,1,2], [2,3,4]) Result: [0,1,2,2,3,4](5) Jquery.unique (array)Deletes the repeating element in the array. Handles only the deletion of an array of DOM elements, not a string or a numeric array.$.unique ([0,1,2], [2,3,4]) results: [0,1,2,3,4](6) Arguments (add content)JavaScript does not have the function of overloading functions, but the arguments object is capable of simulating overloads. Each function in Javascrip has a
The jquery selector inherits from the style of CSS, and can be used to identify specific DOM elements through the jquery selector, and then handle the element accordingly. jquery not only supports simple tag selectors, class selectors, ID selectors, but also provides selectors for form states, child elements, and eleme
Sharp jquery-DOM operations, jquery-dom1. Search nodes ① you can search Nodes Based on the jquery selector ② available. text () to get the text content of the node ③ available. attr ("attr") obtains the attribute value2 to create a node. ① The jquery factory function can be
(){ $('ul Li'). Click (function(){ //this refers to the currently clicked Dom object, using $ (this) to convert the jquery object $( This). addclass ('Active'). Siblings ('Li'). Removeclass ('Active'); }) }) Script> Body>HTML>ToggleclassDelete (add) A class if it exists (does not exist).Syntax: Toggleclass (' box ')$ (' span '). Click (function() {
($ (value). Text () + "QQQ")}). Size (). Length returns the number of queried arraysConsole.log ($ ("#ul li"). Size ()) Console.log ($ ("#ul li"). Length). Get () The JQuery object, into the JS object into the index to take out the first few, and to the JS object does not pass parameters, that is, all the objects in jquery, to the JS objectConsole.log ($ ("#ul Li"). Get ())$.each (arr, obj,function () {})
JQuery's property manipulation module is divided into four parts: HTML property Manipulation, Dom property manipulation, class-style manipulation, and value manipulation
html属性操作:是对html文档中的属性进行读取,设置和移除操作。比如attr()、removeAt
JQuery's property manipulation module is divided into four parts: HTML property Manipulation, Dom property manipulation, class-style manipulation, and value manipulation
html属性操作:是对html文档中的属性进行读取,设置和移除操作。比如attr()、removeAt
The jquery object has its own properties and methods, so let's look at the property operations of jquery.JQuery's property manipulation module is divided into four parts: HTML property Manipulation, Dom property manipulation, class-style
For the full name of the DOM, as you all know, DOM is the acronym for Document Object model, which means that it is the documentation objects. Dom is a browser, platform, language-independent interface that uses a DOM interface to easily access all the standard components in a page.
JQuery's property manipulation module is divided into four parts: HTML property Manipulation, Dom property manipulation, class-style manipulation, and value manipulation
html属性操作:是对html文档中的属性进行读取,设置和移除操作。比如attr()、removeAt
JQuery's property manipulation module is divided into four parts: HTML property Manipulation, Dom property manipulation, class-style manipulation, and value manipulation
html属性操作:是对html文档中的属性进行读取,设置和移除操作。比如attr()、removeAt
First, jquery operation Dom-queryHTML operations-HTML (): Reads or modifies the HTML content of a node, similar to the innerHTML property in JavaScript650) this.width=650; "src=" Http://s5.51cto.com/wyfs02/M01/7E/6C/wKiom1b-X2yxgKrTAABY4VoUGQs797.png "title=" Web.png "alt=" Wkiom1b-x2yxgkrtaaby4vougqs797.png "/>Text manipulation-Text (): Reads or modifies the tex
jquery Objects and Dom objectsThe following is excerpted from Mu class. jquery objects are not the same as DOM objectsWith a simple example, it is easy to distinguish between jquery objects and DOM objects:id= "IMOOC">P> We're
The original link Http://www.cnblogs.com/ouyangping/p/6439939.htmljQuery object is not the same as the DOM objectWith a simple example, it is easy to distinguish between jquery objects and DOM objects:We're going to get the DIV element with the ID IMOOC on the page and add a text to the text node: "Hello,world" and make the text color red.Processed by standard ja
A very important part of 1.jQuery is the ability to manipulate the DOM , set content and propertiesThree simple and practical jQuery methods for DOM manipulation:
Text ()-Sets or returns the text content setting for the selected element only by writing text ("Hello
This article briefly introduces the jquery Mobile and Replication DOM node program implementation, there is a need to learn friends can refer to.
When you do a project, you need the DOM node to move, as in the following code:
Copy Code code as follows:
You need to move the P tag to the DIV tag, and after testing, it's convenient
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.