XML attributes using JS code
in my xml page i have the following elements
<category type="cool" />
I know i can use this line of code
var title = $(this).find('title').text();
to access the text between the title tags but i dont know how to access the attribute of the category tag.
i have tried this
var catType = $(this).find('category').attr('type');
but that doesn't work...
does anyone know the syntax to access the attribute.
Last edited by Kor; 12-04-2009 at 03:21 AM.
i am using jquery...i think...
to be honest i dont really know what i am doing with the code i am utilising. More of a guess and check method to getting what i want...hacking if you will.
I dont really understand how to get what i want from an xml...none the less i dont have time to really understand it at this point.
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)