XDRichardssa
New Member
for example I've got this XML:\[code\]<data> <area> <state>SABAH</state> <parlim>P1</parlim> <name>Alice Smith</name> </area> <area> <state>SABAH</state> <parlim>P2</parlim> <name>John Smith</name> </area> <area> <state>SABAH</state> <parlim>P3</parlim> <name>Peter Smith</name> </area> <area> <state>SARAWAK</state> <parlim>P4</parlim> <name>Paul Smith</name> </area></data>\[/code\]I'm parsing it to a html table with jquery:\[code\] $.ajax({ type: "GET", url: "parse.xml", dataType: "xml", success: function(xml) { $(xml).find('area').each(function(){ var Col0 = $(this).find('state').text(); var Col1 = $(this).find('parlim').text(); var Col2 = $(this).find('name').text(); $('<tr></tr>').html('<td>'+Col0+'</td><td>'+Col1+'</td><td>'+Col2+'</td>').appendTo('#chart'); }); } });});\[/code\]How do I make it so that it ONLY shows results with the state SABAH (which is the first 3 results)? Thanks in advance