I have some XML as below. If I know the title attribute is: c4d5c5 how do I get the mode attribute (four)?
<swatch title="af588b" name="color" width="50" height="50" mode="one"></swatch>
<swatch title="b1977c" name="color" width="50" height="50" mode="two"></swatch>
<swatch title="bfca64" name="color" width="50" height="50" mode="three"></swatch>
<swatch title="c4d5c5" name="color" width="50" height="50" mode="four"></swatch>
<swatch title="c5dbd9" name="color" width="50" height="50" mode="five"></swatch>
<swatch title="c181a4" name="color" width="50" height="50" mode="six"></swatch>
<swatch title="ca936c" name="color" width="50" height="50" mode="seven"></swatch>
Something like this? (this does not work but this is where I am at the moment)
$(xmlDoc).find('swatch').each(function() {
var myMode = $(xmlDoc).find('mode[title="c4d5c5"]');
console.log(myMode+" myMode");
});
No comments:
Post a Comment