JSFiddle - React, Tailwind, and code Playground
by msh6180339
HTML
<div id="result"></div>
JavaScript
var $collection1 = $('<div />', { text: 'Node 1' });
/*
.after() must not add new element to the target but it's true to return a collection of two.
*/
$collection2 = $collection1.after($('<div />', { text: 'Node 2' }));
$('#result').html('jQuery version: ' + $.fn.jquery + '<br />$collection1.length (must be 1): ' + $collection1.length + '<br />$collection2.length (must be 2): ' + $collection2.length);