convert the html elements into json