Current location - Quotes Website - Personality signature - How to use Jquery to get the Class or ID of a certain Div
How to use Jquery to get the Class or ID of a certain Div

To obtain the attribute name based on attr (attribute), you must know the class name or id name of the upper-level div,

or you know the class or id of the div to obtain other attributes. This is all done. $("#d1").attr("xxx");xxx is the value of an attribute you want to get.

The complete list is as follows:

$("#div1").find("div").attr("id")

$("#div1").find("div").attr("class ")