I've made a script that does not work in IE8 or lower because the browsers do not support the javascript calls and css in it. The script works fine in Firefox, Chrome, Internet Explore 9 and 10. I added the script to the end of a label in a course so when the page loads the script will run. The script is designed to only effect what is in the label.
To stop it stuffing up in IE8 or lower this is the code I wrote for a label.
<div id="run-script-to-this">
**normal HTML code for label**
</div>
<!--[if (!IE)|(gt IE 8) ]>
<script type="text/javascript">// <![CDATA[
**javascript code to effect label**
// ]]></script>
<![endif]-->
But this completely destroys the script in all browsers. What am I doing wrong?
I'm running Moodle 2.3.2