Fixed Javascipt code, will now edit HTML properly