JSFiddle - React, Tailwind, and code Playground

HTML

<select><option value="apo'stroph">apo'stroph</option></select>

JavaScript

var val = "apo\\'stroph";
var test = $('option[value="'+val+'"]');
console.log(test.length); //works
console.log(test.val());