converting object attribute to html element for javascript to grab