I have the following code and I want to get the desired css property of the element and not the computed/applied ones. For example the computedStyle.width should have an undefined value. How can I accomplish this?
//html
<div class="hello">
helloInnerText
</div>
//css
.hello{
height: 10px;
background-color:red;
}
//js
let ele = document.querySelector(".hello");
let computedStyle = window.getComputedStyle(ele);
console.log(computedStyle.backgroundColor);
console.log(computedStyle.height);
console.log(computedStyle.width); // <- This should be undefined or ""