Thanks. I discovered that solution on my own, but right on the money. Re: the bad XHTML, you're correct. I was trying to come up with an example for the question, and I guess I failed. Still, thanks!
-- Yehuda
On 10/3/06, Klaus Hartl <[EMAIL PROTECTED]> wrote:
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/
--
Yehuda Katz
Web Developer | Wycats Designs
(ph) 718.877.1325
_______________________________________________ jQuery mailing list [email protected] http://jquery.com/discuss/
