JSFiddle - React, Tailwind, and code Playground

by Mottie

HTML

Non-IE browsers will return "null".<br>
IE (older than IE9) returns "div1" in all jQuery versions except v1.2.6.
<br>
<hr>
Results:
<div id="display"></div>
<hr>
<div class="test">div1</div>

JavaScript

var a = $('.test:eq(-1)').html(),
    b = $('.test').eq(-1).html(),
    c = $('.test').eq(-2).html(),

    txt = '":eq(-1)" = ' + a + '<br>' +
          ' .eq(-1)  = ' + b + '<br>' +
          ' .eq(-2)  = ' + c + '<br>';


$('#display').html(txt);