The When called on the Warning: This is a live Parameters
A string representing the class name(s) to match; multiple class names are separated by whitespace. Return valueA live ExamplesGet all elements that have a class of 'test':
Get all elements that have both the 'red' and 'test' classes:
Get all elements that have a class of 'test', inside of an element that has the ID of 'main':
Get the first element with a class of 'test', or
We can also use methods of Array.prototype on any
Get the first element whose class is 'test'This is the most commonly used method of operation.
Multiple Classes Example HTML
JavaScript
ResultSpecifications
Browser compatibilityBCD tables only load in the browser |