Basic selection:
var people = $(xml).find("person");
This will select all nodes with the name of "person".
Selection where attribute exists:
var people = $(xml).find("person").attr("id");
This will select all nodes with the name of "person" but which also have an attribute with the name of "id".
Selection based on attribute value:
var people = $(xml).find("person[id='1']");
This will select all nodes with the name of "person" but which also have an attribute with the name of "id" which in turn has a value of "1".
No comments:
Post a Comment