Are you trying to run HTML in Moodle or show the code?
As an instructor in Web Design, I had a difficult time placing HTML code in a quiz not to be run but as part of the question. Unfortunately, Moodle will try to run any code it sees making a mess of my questions. I found it easy to show a tag by placing a space in it. ( <div< vs < div>) it works fine.
If you want to run code then this suggestion is of no merit... (: