Is there any way to compute element width without using append. I have a div inside a page and need to calculate its width it can have script tags in it.
<div>
<script>
alert("Testing");
console.log("Duplicate");
</script>
</div>
I have a page that loads some data through ajax call. Before adding that data on page, I have to do modification in JS (ex: fetching and modifying width of parent according to child(above div) ).
Using append resulted in script execution without actually being loaded on page. PS: use display and visibility, didn't worked here.