JSFiddle - React, Tailwind, and code Playground
HTML
<select id="my-select">
<option val="1">1</option>
<option val="2">2</option>
</select>
JavaScript
(function( $ ) {
$.fn.userSelect = function(value) {
this.each(function(){
alert(this.innerHTML); // undefined
this.style.webkitUserSelect = value;
this.style.mozUserSelect = value;
this.style.oUserSelect = value;
this.style.msUserSelect = value;
this.style.userSelect = value;
});
};
})(jQuery);
$(document).ready(function(){
$('#my-select').userSelect();
});