[jQuery] Re: Creating a new tag

2009-09-24 Thread Xi Shen
$('a') means selecting all the 'a' tag element and set their attribute. if you want to create an new element and add it to your page, try var newAtag = $(document.createElement(a)).attr(...); $(select the parent element).append(newAtag); On Thu, Sep 24, 2009 at 5:06 PM, Coxy

[jQuery] Re: Creating a new tag

2009-09-24 Thread g...@iec
var link = $('a/a').attr(attribute_name,value); $(target_element).append(link); This will work. On Sep 24, 2:06 pm, Coxy stephenbung...@yahoo.de wrote: How do I create a new tag with jquery? I tried something like this: link = $('a').attr({                 class   : 'logoLink',          

[jQuery] Re: Creating a new tag

2009-09-24 Thread Giovanni Battista Lenoci
Coxy ha scritto: How do I create a new tag with jquery? I tried something like this: link = $('a').attr({ class : 'logoLink', target : '_blank', href: 'http://www.someurl.com/' }); And then appended it to another image, but this