By removing the class from the range and setting it to JavaScript, the browser will apply the transition, but this only works with the first .skill-bar . Also .getElementsByClassName will not work in IE8 or lower.
HTML
<div class="skill-bar"><span></span></div>
Javascript
document.getElementsByClassName('skill-bar')[0].getElementsByTagName('span')[0].className = 'w70';
(so just wrap this in a <script> element after HTML or see run the function when the page loads
Pure JavaScript Demo
You probably want the jQuery solution (or other framework) to provide compatibility with multiple browsers, but this creates a structural dependency. If you enable jQuery, it will be great. If not, you need to enable this library first and then use:
JQuery
$(window).load(function(){ $('.skill-bar span').addClass('w70'); });
jQuery daemon
Right-click on the output frame and select "View Frame Source" to see the output code.
andyb
source share