You might have solved this by now. Your HTML code is clearly beyond what the built-in WYSIWYG editor can handle. One way: switch to the raw HTML editing mode (button <>). In that mode, it should save HTML as entered by you. Another way: turn WYSIWYG editor off altogether (in your user settings) before editing this resource.
Moodle 1.9 HTML Issue
This discussion has been locked because a year has elapsed since the last post. Please start a new discussion topic.