javascript to produce valid html5