samedi 23 janvier 2016

How to get the border width in javascript?

I try this :

var playGard =document.getElementsByClassName("playGard")[0];

var borderW= getComputedStyle(playGard,null).getPropertyValue('border-left-width').substr(0,2);

I get the value "10".

There is a better shorter way in javascript?




Aucun commentaire:

Enregistrer un commentaire