What is the difference between a class selector and an ID selector? What is the difference between setting id="ID name" for a tag instead of class="class name"? -PHP Chinese Questions and Answers - What is the difference between a class selector and an ID selector? What is the difference between setting id="ID name" for a tag instead of class="class name"? -PHP Chinese website Q&A
What is the difference between a class selector and an ID selector? What is the difference between setting id="ID name" for a tag instead of class="class name"? -PHP Chinese Questions and Answers - What is the difference between a class selector and an ID selector? What is the difference between setting id="ID name" for a tag instead of class="class name"? -PHP Chinese website Q&A
Please watch and learn.
当然有区别了,对于dom而言,id是唯一的,class是可以多个的