constructing html in javascript