changing class of a <span> element with JavaScript

css, dom, javascript

Solution

.className rather than .class

Problem

I am trying to change the class of a element with Javascript using the below code: ``` parent.document.getElementById('<?php echo $markid ?>').class = 'unlistened'; ``` Not having much luck though. How do I do this properly?

Original source