Question

Let's say we have this:

<article>
 <div id="zoo">...</div>
</article>

I want to be able to add a class to <article> using MooTools.

If I was using Jquery, I would use the following code:

$("div#zoo").parent().addClass("blog");

(http://jsfiddle.net/yannisdran/Eq2tY/)

resulting this in the DOM:

<article class="blog">

However, I need it in MooTools. How do I have to express this code?

Was it helpful?

Solution

       $('zoo').getParent().addClass('blog');

And here is the fiddle... JSfiddle

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top