Added javascript to change preview to html