I know similar questions have been asked but I've not been able to find a solution that works.
Can someone suggest how I could fetch the value of the width attribute from the CSS class so I can write it to the div.
Happy to do this with jQuery is possible.
document.getElementById("myDiv").innerHTML = 'value of CSS width';
border: 1px solid red;
<div id="myDiv">Hello World!</div>
This article from the jQuery documentation may help you. http://api.jquery.com/css/