mercredi 6 mai 2015

jQuery - Ask for width or height in percent % and returns me in 0 pixels

I've set styles in % like:

<style>
#somediv {width:70%}
</style>
<div id="#somediv"></div>

And it returns me the result in pixels with jQuerys css() function

$(document).ready(function(){
var css = $("#somediv").css('width');
console.log(css);
})

Aucun commentaire:

Enregistrer un commentaire