Is there a more efficient way of setting the width of DOM elements like this? The code is running at 60fps and the framerate is pretty much up and down. Should I use Canvas for this or is there a better way?

JavaScript code:
Code:
var value = 50,
     bar = document.getElementById('bar').style;

function loop() {
Math.random() < 0.5 ? value += 3 : value -= 7;
bar.width = value + "%"
setTimeout(loop,16); // run at 60 fps
}

loop();
HTML code:
HTML Code:
<div id="bar"></div>