Like ParentNode and parentelement functions,childnodes and children function as well. But parentnode and childnodes are consistent with the standard of the Global Consortium, which can be said to be more generic. While the other two are only IE
From the JavaScript Authority Guide (jquery's ultimate way to find elements based on the style selector is to get all the DOM elements with getElementsByTagName (*), and then filter all DOM elements according to the style selector)
Today, we tried
GetAttribute () method
So far, we've introduced two ways to retrieve a particular element node: one is using the getElementById () method, and the other is using the getElementsByTagName () method. Once we find that element, we can use the
1, getElementById ()
The getElementById () method returns a reference to the first object that has the specified ID.
this is a Header
click on the header to alert its value
2. getElementsByTagName ()
The getElementsByTagName () method
Document ObjectEach HTML document that is loaded into the browser becomes the object of the document, allowing us to access all of the elements in the HTML page from the script, which is part of the Window object and can be accessed through the
Use explicit std:: qualification#include
int main (){int Val;
Std::cout
Std::cin >> Val;
Std::cout Std::cout
return 0;}
Instance two gives the global namespace only a few names
#include
Gain access to cout, CIN, and HexUsing
Ajax
Ajax is made up of HTML, JavaScript™ technology, DHTML, and DOM, an excellent way to translate clumsy WEB interfaces into interactive Ajax applications. The author of this article is an Ajax expert who demonstrates how these technologies work
Javascript| Browser
First, detect the name of the browserProblem:The standard support for JavaScript is different for different browsers, and sometimes you want the script to work well on different browsers, and then you need to detect the browser,
"ParentNode"
Used to get the parent node of an element. To understand parentnodes as a container with a child node in the container
Cases:my text
In the above code, you see "Dad" as a div container, the container has a "child", is the bold text
1, always use #id to find element.
The fastest selector in jquery is the ID selector ($ (' #someid ')). This is because it maps directly to the getElementById () method of JavaScript.Select a single element
traffic light
red
If you really have mastered the first few. Implementing the Ajax removal feature is as erratic as it can be. All I have to teach you is. Flexibility to use JavaScript and DOM to achieve a cool delete effect. Actually you learn to come here. It is
Ajax is made up of HTML, JavaScript™ technology, DHTML, and DOM, an excellent way to translate clumsy WEB interfaces into interactive Ajax applications. The author of this article is an Ajax expert who demonstrates how these technologies work
How to detect browsers with Javascript seems like a cliché. Based on my experience, using Javascript to detect browsers is nothing more than two broad classes of methods.
One is to use the feature properties that use the browser. For example, to
To support both Firefox and IE, we often use the document.getElementById (ID) method to get the HTML object. However, the getElementById method can only get a single object, and there is nothing for a checkbox array.
1. Download the latest version
Found This article on Twitter, a simple selected passage:
Always inherit from ID selector
Use the tag before class
Caching a JQuery object
Mastering the powerful chain operation
Using subqueries
Restricting direct DOM operations
Bubble
Eliminate
ajax| Tutorial
Ajax is made up of HTML, JavaScript™ technology, DHTML, and DOM, an excellent way to translate clumsy WEB interfaces into interactive Ajax applications. The author of this article is an Ajax expert who demonstrates how these
Nowadays, more and more jquery applications are available. Some people ignore performance problems when enjoying coding, such as me. although jquery has excellent performance in many js class libraries, it is not developed using native javascript,
DOM is the initial abbreviation of "DocumentObjectModel" (Document Object Model. Chapter 3 DOM
DOM is the abbreviation of "Document Object Model" (Document Object Model.
Node
Element node: it is the DOM atom. For example, the name of a text
Recently, the project needs to develop an application related to Baidu map. You need to extract the desired elements and attribute information from the hardcoded html string, because dom objects or jq objects are used to operate element nodes and
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.