Using javascript variable for setting CSS style values not work, this is my javascript code:
imageH.src = "image.jpg";
imageH.onload = function() {
var valueH = (this.height/this.width)*100;
}
var div1 = document.createElement('div');
div.style.paddingTop = valueH + '%';
this not work, but if i use the value betwen "" :
div.style.paddingTop = "60%";
it work.
Thanks!!