You need to inject the newly created div somewhere:

img.inject($(document.body));

On 23 Jul 2009, at 11:40, group.addEvent('me'); wrote:


Hi,

I'm trying to make a new div element whenever I click a link.

The code below doesn't work:

$('link').addEvent('click', function(){
                var img = new Element('div', {
                        'id': 'img'
                        }
                );
});

Any help would be greatly appreciated!

:)

Reply via email to