JSFiddle - React, Tailwind, and code Playground
by Tom DeBerardine
HTML
<div id="KFZ"></div>
JavaScript
$(document).ready(function () {
$("#KFZ").append("<ol></ol>");
$.ajax({
type: 'GET',
//url: 'KFZ.xml',
dataType: 'xml',
url: '/echo/xml/', //only for fiddle
type: 'post', //only for fiddle
// data only for fiddle
data: {
xml: '<?xml version="1.0" encoding="utf-8"?><LIST><KFZ><Herst>Citroen</Herst><Mod>DS3 Racing</Mod></KFZ><KFZ><Herst>Peugeot</Herst><Mod>206 RZ</Mod></KFZ><KFZ><Herst>Mercedes Benz</Herst><Mod>C63 AMG</Mod></KFZ><KFZ><Herst>Mini Cooper</Herst><Mod>John Cooper Works</Mod></KFZ></LIST>'
},
success: function (xml) {
$(xml).find('KFZ').each(function () {
var sHerst = $(this).find('Herst').text();
var sMod = $(this).find('Mod').text();
$('<li></li>').html(sHerst + ', ' + sMod).appendTo('#KFZ ol');
});
},
});
});