I have a div, and I'd like to know if there's a way to get its width in percentage using jQuery.
Here's my code:
$(document).ready(function(){
var f = $('.f').width();
alert(f);
});
I tried to use %
as an argument like this width(%)
, but this is setting the width as %
not getting the value in a percentage format. Can someone tell me what should I do to get in percentage instead?
Any help is profusely appreciated.