سؤال

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?

هل كانت مفيدة؟

المحلول

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

And here is the fiddle... JSfiddle

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top