$('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
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',
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
3 matches
Mail list logo