My question is, how can i get width parameter of class css style?
For example i have <div class="page css-1" id="page1">
div with id=page and classes "page" and "css-1". I want to get width parameter of css-1 class style?
The easiest way is probably to ignore that <div>
, create a new one with the class you care about and check its style attributes. You need to add it to the DOM for it to adopt the CSS of the document.
var div = $('<div>').addClass('css-1').hide();
$('body').append(div);
var width = div.css('width');
div.remove();
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With