I have a code similar to this:

```
var a = document.createElement('div');
a.style.width = '200px';
a.style.fontSize = fontSize(a.offsetWidth, 5);
a.innerHTML = 'Example';
document.body.appendChild(a);

function fontSize(reference, factor){
  return (reference*factor)/100 + 'px';
}

```

However when I run it, the element font size appears to be 0px. The `console.log` returns expected value tho.

Similar code works on an javascript object that I tried:

```
var Object = function(target){
  var default = {
    fontSize: fontSize(target.clientWidth, 5);
  }
}

```

[jsFiddle here](https://jsfiddle.net/frp3hdcy/)

What did I do wrong?