[jQuery] Re: Calling an element tag and the value inside one of it's attributes

2009-05-04 Thread Blaine
Expanding on my example below, with the each function. First final all elements. Then do whatever you want with the element. $("span[printData]").each( function( key, elementRef){ alert( $(elementRef).text() ); }); On May 4, 2:16 pm, Andy H wrote: > Here is an actual example.  Would anyone kno

[jQuery] Re: Calling an element tag and the value inside one of it's attributes

2009-05-04 Thread Blaine
You need to read the jquery selector docs at http://docs.jquery.com/Selectors/attributeHas#attribute Below is the code that will get your data. $("span[printData]").text(); On May 4, 12:33 pm, Andy H wrote: > For some reason this post disappeared.  Can anyone answer this? > > Thanks! > > On

[jQuery] Re: Calling an element tag and the value inside one of it's attributes

2009-05-04 Thread Andy H
Here is an actual example. Would anyone know why this isn't working? What I find weird is if I do a single line (alert($("span").attr ("printElement"));) it works fine. But if I try to use the each() function following it, nothing happens. Any help would be great. Thanks! HTML:

[jQuery] Re: Calling an element tag and the value inside one of it's attributes

2009-05-04 Thread Andy H
For some reason this post disappeared. Can anyone answer this? Thanks! On May 1, 10:01 am, Andy wrote: > This is an odd questions.  I have a huge form with a lot of data. > There is a table that data in it I need to display on a print screen > (of course this data isn't being displayed in th