add function to replace the attributes of the html tag.