An unstyled div element already has several CSS declarations by default. For example:
cursor:auto;
display:block;
float:none;
font-size:16px;
(and several other statements)
Note the example below:
document.querySelector('.div1').style.padding = '20px';
.div1 {
background-color: skyblue;
}
<div class="div1" style="border-radius: 5px;">word</div>
How can I get only the styles that have been defined in the stylesheet and JavaScript, ignoring all other default declarations?
I would like to get the following output:
background-color: skyblue;
border-radius: 5px;
padding: 20px;