Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

select xml child element with jQuery

var xmlString = "<route><name>Lakeway</name><abrv>LAKE</abrv><eta><time>00:30</time><dest>MAIN</dest></eta></route>",
xmlDoc = $.parseXML( xmlString ),
$xml = $( xmlDoc ),
$abrv = $xml.find( "abrv" ).text() == "LAKE" ? $xml.find( "abrv" ) : false;

var time = $abrv.next().children("time").text();
var dest = $abrv.next().children("dest").text();

alert(time + " " + dest);
Comment

PREVIOUS NEXT
Code Example
Javascript :: check if word has accented or unaccented javascript 
Javascript :: d3js circle out of scrren 
Javascript :: how to make apk in android studio reac native 
Javascript :: how to create duplicate key array in javascript 
Javascript :: parent folder of file extendscript 
Javascript :: jquery nested ul li 
Javascript :: HTML5 Accesskey Attribute: you may not need JavaScript to add Keyboard Shortcuts 
Javascript :: contact form7 404 wp-json feedback 
Javascript :: How to send JSON Web Token (JWT Token) as header with Postman and golang 
Javascript :: input search picture jquery 
Javascript :: coment executer des touche de clavier avec du js 
Javascript :: event handler attachment jquery 
Javascript :: Why is #_=_ appended to the redirect URI? passport facebook 
Javascript :: gatsby underline link if page is active 
Javascript :: fetch is not defined amazon-cognito-identity-js 
Javascript :: password textInput not working on android 
Javascript :: map.getIn gives whole data if prop missing in js 
Javascript :: Enzymes are proteins that speed up reactions by 
Javascript :: pool question json online api example 
Javascript :: most popular company with nodejs 
Javascript :: java code that writes code in powerpoint 
Javascript :: how do you make your script work on one window 
Javascript :: javascript copy array map 
Javascript :: greater than x but less than y es6 
Javascript :: curl node exporter 
Javascript :: yeoman promise 
Javascript :: bundle all css js files 
Javascript :: react native navigation paramlist never used 
Javascript :: video pop js 
Javascript :: pass color json api 
ADD CONTENT
Topic
Content
Source link
Name
2+5 =