A JavaScript function to convert the HTML into JSON Object