HTML5 Loop Adjustment