Reputation: 2752
Mootools code:
window.addEvent('domready', function() {
var homeLink = $$('a.pathway');
new Element('a', {'href': '/ru/produktsiya', 'html': 'Click me!'}).inject(homeLink, 'after');
});
Why didn't work?
Upvotes: 0
Views: 1123
Reputation: 7273
$$
returns a collection of elements, which you cannot inject a single element after, of course.
window.addEvent('domready', function() {
var homeLink = $$('a.pathway');
new Element('a[href="/ru/produktsiya"][text="Click me!"]'}).inject(homeLink[0], 'after');
});
You can also use CSS selector logic to more easily create elements, as I've done above:
Upvotes: 2