JSFiddle - React, Tailwind, and code Playground
HTML
<h1>The color of the input box is initially white. If the selector works, it should change to green.</h1>
<hr />
<h2>querySelectorAll</h2>
<input id="a" type="text" value="a'b]<p>" />
<h2>jQuery</h2>
<input id="b" type="text" value="a'b]<p>" />
CSS
h2 {
font-weight: bold;
font-size: 1.5em;
}
input {
background-color: white;
font-size: 1.25em;
padding: 5px;
margin: 10px 0;
display: block;
}
JavaScript
// green with querySelectorAll
var a = document.querySelector("[value=a\\'b\\]\\<p\\>]");
a.style.backgroundColor = 'green';
// green with jQuery
var b = $("[value=a\\'b\\]\\<p\\>]");
b.css('background-color', 'green');