This function takes html code and either replaces or adds to DOM element attributes.