Yehuda Katz schrieb:
> Say I have something like this:
> 
> $("p").attr("rel", "someRel")
> 
> But instead of setting it as static, I want to set it based upon the 
> attributes of the p's in question. For instance, say I want to set the 
> rel to be the same as the class. Is there any way to get access to the 
> DOM element being worked on while inside a function call? this doesn't 
> seem to work...


You could accomplish that with an each loop:

$("p").each(function() {
     this.rel = this.className;
});


By the way, there is no rel attribute for a <p> element.


-- Klaus

_______________________________________________
jQuery mailing list
[email protected]
http://jquery.com/discuss/

Reply via email to