Malitios Java script?

Malitios Java script?

by Marvin Schön -
Number of replies: 0

Hi,

i got a premade moodle with HTML sites and Java script. It is working fine. But whenever i want to edit the sites, i cant switch von the wysiwyg editor to the HTML editor. And the Java script parts of the sites get broken, when I save the sites. You can not click on them anymore.

I found out, that everything works fine, if i delete the Java script content. The script lines look as following:

<p><a onclick="function onclick(event) { document.getElementById("loesung2").style.display = ""; }" href="javascript:void(0);">Lösung anzeigen</a> </p>
<div style="display: none; color: red;" id="loesung2">falsch</div>

why does this specific Javascript break my moodle?

Tanks alot.

Average of ratings: -