JSFiddle - React, Tailwind, and code Playground
by ajpiano
HTML
The "Select Me" div should have a red border and green background. The red border never draws because the string passed in as "this" from the array is passed in as type object, which jQuery then fails to detect as a string, and proceeds down a failed codepath.
<div id=SelectMe>Select Me</div>
<div id=output></div>
CSS
body {
font-family: Verdana;
font-size: 10pt;
}
JavaScript
var selectors = ['#SelectMe'];
$.each(selectors, function(i, sel) {
var selectMeA = $(sel);
var selectMeB = $(selectors[i]);
selectMeA.css('border', '1px solid red');
selectMeB.css('background', '#0f0');
$('#output').text(typeof(this) + ', ' + typeof(selectors[i]));
});