JSFiddle - React, Tailwind, and code Playground

by lshettyl

HTML

<div id="dbdisplay"></div>

CSS

#dbdisplay {
    
    display: none;
    height: 200px;
    width: 200px;
    background: green;
}

JavaScript

//Check if there is querystring matching db=somevalue
//and if "no", display the div
if (!location.search.match(/db=[^&#]+/i)) {
    $("#dbdisplay").show();
}

$(document).on("change", ".checkbox", function () {
   var db = $(this).val();
   window.sessionStorage.setItem("db", db);
   window.location.assign("index.php?db=" + db);
   $("#dbdisplay").hide();
});