html2js implementation