how to create and append element in javascript