build dom in javascript