JSFiddle - React, Tailwind, and code Playground

by danheberden

HTML

<div></div>

JavaScript

var xml ="<xml><model><jCpu><Intercept>jCpu_Inter_1</Intercept></jCpu><heap><Intercept>heap_Inter_1</Intercept></heap><host>px0</host></model><model><jCpu><Intercept>jCpu_Inter_2</Intercept></jCpu><heap><Intercept>heap_Inter_2</Intercept></heap><host>px5</host></model></xml>",
     xmlDoc = $.parseXML( xml ),
     $xml = $( xmlDoc );


// append "XML Title" to the div
   string = "<p>" + $xml.find('jCpu Intercept').text()+"</p><p>"+
                    $xml.find('jCpu > Intercept').text()+"</p>";
            $('div').html(string);