This should do the job:
$("#someid").each(function() { $(this).text($(this).attr("alt")); });
It is longer and more unreadable than your original code
$("#someId").text($("#someId").attr("alt"));
but you do get rid of redundancy = you do not have to write the same
selector twice, which is gener
On Dec 31, 1:19 pm, Nathan Klatt wrote:
> But, that seems like too much code for jQuery. :) I want something
> like:
>
> $someId.text(self.attr("alt"));
I've often wanted something like that too. Unfortunately...
> This doesn't work:
>
> $someId.text($(this).attr("alt"));
>
> Does that function
2 matches
Mail list logo