In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/02 Report--
This article introduces the relevant knowledge of "what is the difference between dom and jquery objects". In the operation of actual cases, many people will encounter such a dilemma, so let the editor lead you to learn how to deal with these situations. I hope you can read it carefully and be able to achieve something!
The difference: 1, the DOM object uses the JavaScript method to obtain the object returned by the elements in the page, while the jquery object uses the jquery method to obtain the object returned by the element in the page; 2, the DOM object can only access the predefined methods in the DOM, and the jquery object can only call the methods provided by jQueryr.
The operating environment of this tutorial: windows7 system, jquery1.10.2 version, Dell G3 computer.
Dom object
Document object Model (DOM) is a standard programming interface recommended by W3C to deal with extensible markup language.
DOM is actually a document model described in an object-oriented way. DOM defines the objects needed to represent and modify the document, their behavior and properties, and the relationships between them.
With DOM, you can access all HTML elements, along with the text and attributes they contain. You can modify and delete the contents, and you can also create new elements.
DOM is independent of platform and programming language. It can be used by any programming language such as Java, JavaScript, and VBScript.
The DOM object is the object that we get using the traditional method (javascript).
DOM is precisely a standard for document objects (document object model), which only defines the behavior of properties and methods.
JQuery object
The jQuery object is actually an array of JavaScript, which contains 125 methods and 4 properties.
The four attributes are:
Jquery's current jquery framework version number
Length indicates the number of elements of the array object.
Context generally points to a HtmlDocument object.
Selector content passed in by selector
The jquery object is the object that results from wrapping the DOM object through jQuery. JQuery objects are unique to jQuery and can use methods in jQuery, but not methods in DOM; conversely, Dom objects cannot use methods in jquery.
The difference between jQuery object and DOM object
1. Different definitions
DOM object: the object returned by using the method in JavaScript to get the elements in the page is the DOM object, and the method defined by jquery cannot be used.
Var dom-elem = document.getElementById ("msg")
JQuery object: the jquery object uses the jquery method to get the elements in the page. The object returned is the jQuery object. You can use the methods defined by jquery.
Var jquery-elem = $("# msg")
2. Get different
The DOM object is the document.getElement to get the dom object, and the DOM object can only access predefined methods in DOM.
The jQuery object is the returned object processed by the $() object, which is an array of jQuery and can only call methods provided by jQueryr.
That's all for the content of "what's the difference between dom and jquery objects". Thank you for reading. If you want to know more about the industry, you can follow the website, the editor will output more high-quality practical articles for you!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.