I often use the CSS universal selector to reset the dimensions in my HTML document:
* {
border: 0;
margin: 0;
padding: 0;
}
Can this be done with JavaScript too?
For normal HTML elements there is the style property.
But how to speak to the universal selector?
getElementsByTagName("*")will return all elements from DOM. Then you may set styles for each element in the collection: