Alex Rivera | Logout

changing class of a <span> element with JavaScript

Asked 2009-07-09T13:06:05.483
12

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?

Edit
Report

1 Answer

-3

Use jQuery...

$("tagname").addclass("unlistened");

http://docs.jquery.com/Attributes/addClass

answered 2009-07-09T13:09:10.010

Your Answer