So I have a string like this
string = "<user>username 1<notes>Notes of User 1</notes></user> <user>username 2<notes>Notes of User 2</notes></user>"
How could I parse the string in Javascript or JQuery to pull out the “Notes” of either user 1 or user 2.
So I’ll have a variable like this:
variable = user;
printout notes of user.
to identify the notes of user1 or user2 you need to change your xml a bit
notice that i added
id=user1here is the fiddle http://jsfiddle.net/Qa5sP/
EDIT after the -1 🙁
So, here is the
parseXMLway:Live demo.