JSFiddle - React, Tailwind, and code Playground

by superbDeveloper

HTML

<xml id="xmlSettings">
 <items>
        <item name="Test1">Test data 1</item>
        <item name="Test2">Test data 2</item>
        <item name="Test3">Test data 3</item>
 </items>
</xml>

JavaScript

/*
 * For jQuery < 1.4.2, this returns the element;
 * For jQuery >= 1.4.2, it returns null.
 * 
 * Also effects the following browsers:
 * IE 9 - Emulating IE8,IE7
 * IE 8 - both Compatibility view On/Off
 */

alert($('#xmlSettings').length);


// works fine if you pass in the element directly
alert( $(document.getElementById('xmlSettings')).length );