Although similar questions have been posed before, such as this one, I haven't found a working solution.
Is there a way for me to retrieve the width attribute value from a CSS class and then write it to a div?
I'm looking to access the exact value specified in the class, even if the element has expanded due to its content.
If feasible, I am open to achieving this using jQuery.
document.getElementById("myDiv").innerHTML = 'value of CSS width';
#myDiv {
width: 177px;
border: 1px solid red;
}
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<div id="myDiv">Hello World!</div>