views:

86

answers:

1

Hello! How can i find this span element with class="rocon.rocon-br" in #conttile2 by Mootools' Css Selector? This element is created dynamically by Javascript (rounded corner), so this is what i see in Dragonfly Dom tree for it:

html > body > div#wrapper.wrapper > div#penalties.container > h2#conttitle2.rc10.rocon__8.rocon-init > span.rocon.rocon-br

There are other elements with this class in tree.

I'm trying to get it and hide like this:

$$('h2#conttitle2>span.rocon.rocon-tl').each(function(corners) {corners.setStyle('display','none');});

an even

$('conttitle2').getElements('span[class=rocon rocon-tl]').each(function(corners) {corners.setStyle('display','none');});

But it wont hide at all :( Can you please advise what would be the correct syntax to achieve this element hidden?

A: 

Try this selector:

#conttile2 > span[class~="rocon.rocon-br"]

The attribute selector [attr~=value] is for whitespace-separated list like the value of the class attribute.

Gumbo
thanks, but it unfortunately don't work
moogeek
@moogeek: And your `span` elements are children of the element with the ID *conttile2*?
Gumbo
yes, they become it's children by js
moogeek