JSFiddle - React, Tailwind, and code Playground
by JonNorman
HTML
<select name="texthit" id="texthit">
<option value="1">Yes</option>
<option value="2">No</option>
</select>
<div id="yesquestions">Yes Selected</div>
<div id="noquestions">No Selected</div>
JavaScript
jQuery.noConflict();
(function($){
$(document).ready(function(){
if($("#texthit>option:selected").length==0){
$("#texthit>option[value=1]").attr("selected","selected");
}
$("#texthit").change(function(){
if($(this).val()=="2"){
$("#yesquestions").hide();
$("#noquestions").show();
}else{
$("#yesquestions").show();
$("#noquestions").hide();
}
}).change();
});
})(jQuery);