Home > Article > Web Front-end > Recommended 6 articles about querySelectorAll()
Previously I introduced some newly added selectors in HTML5, namely querySelector(), querySelectorAll() and getElementsByClassName(). These three have their own unique functions. If necessary, you can read the relevant content in HTML5 actual combat and analysis. Today I will introduce to you the classList attribute. What exactly does the classList attribute do? Let’s leave classList alone for now. We consider the question, that is, how do we delete one of the class names among elements with multiple class names? Menglong struggled with his brain and finally came up with a way to achieve it. Delete the class name meng among the three class names li, meng and long. The code is as follows: HTML code
Menglong Station
JavaScript code//Get the p of the class name meng to be deleted var1. How to use getElementsByClassName()? Summary of getElementsByClassName() instance usage
##Introduction: We have introduced some new options in HTML5 The handlers are querySelector(), querySelectorAll() and getElementsByClassName(). These three have their own unique functions. If necessary, you can read the relevant content in HTML5 actual combat and analysis. Today I will introduce to you the classList attribute. What exactly does the classList attribute do? Let’s leave classList alone for now. Let's consider such a question, then...
2. HTML5 actual combat and analysis of the classList attribute
Introduction: I have introduced some newly added selectors in HTML5, namely querySelector(), querySelectorAll() and getElementsByClassName(). These three have their own unique functions. If necessary, you can read the relevant content in Html5 actual combat and analysis. Today I will introduce to you the classList attribute.
3. HTML5 actual combat and analysis of CSS selector——getElementsByClassName() method
Introduction: The querySelector() method and querySelectorAll() method in HTML5 have been introduced to you in the previous articles. I wonder how well you understand it? Review here First, the querySelector() method returns the first element that matches the passed CSS selector; the querySelectorAll() method returns all elements that match the passed CSS selector, which is a NodeList object. After a brief review, let me share a new method-getElementsByClassName() method.
4. HTML5 actual combat and analysis of CSS selector——querySelectorAll()
Introduction: For versions below android 5.0, modify style.xml and add the following code: style name=AppTheme parent=Theme.AppCompat.Light.DarkActionBar> item name=android:actionBarSize>40dpitem> item name =android:windowContentOverl
##5.Questions about querySelectorAll() under IE8_javascript skills
Introduction: Among the new features of IE8, it is mentioned that the querySelector() and querySelectorAll() methods will be supported. I won’t go into how to use them here. I just recorded a problem I encountered when using them.6.
A CSS coverage test script implemented in 20 lines of code_javascript skills
Introduction: Here we only seek the coverage of CSS rules, so just access querySelectorAll().length. By sorting, you can see the usage of each CSS
The above is the detailed content of Recommended 6 articles about querySelectorAll(). For more information, please follow other related articles on the PHP Chinese website!