views:

34

answers:

1

Did jQuery add any sort of new functionality to internal JS object like the "anchor" object?

I know you can select via $("a"), but what happens if i already have an object selected?

A: 

Edit: I missed the first half with this answer.

For the first question: No, jQuery doesn't do this, it adds functionality to jQuery objects which is different. Prototype takes this route, extending DOM elements/properties (though last I heard, they're reversing this in Prototype 2.0).


For the second: If you have a jQuery object pointing to the anchor just call any method on it, like this:

myObject.css('color', 'red');

If it's a DOM element you have, just wrap it using $():

$(myObject).css('color', 'red');
Nick Craver