JSFiddle - React, Tailwind, and code Playground

by psign

HTML

<!DOCTYPE html>
<html>

<head>
    <base target="_top">
    <!-- <meta name="viewport" content="width=device-width, initial-scale=1.0"> 
    INCLUDE REQUIRED EXTERNAL JAVASCRIPT AND CSS LIBRARIES-->

    <script src="https://code.jquery.com/jquery-3.5.1.js"></script>
    <script src="https://cdn.datatables.net/1.10.23/js/jquery.dataTables.min.js"></script>

    <link rel="stylesheet" type="text/css"
        href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/4.5.2/css/bootstrap.css">
    <link rel="stylesheet" type="text/css"
        href="https://cdn.jsdelivr.net/npm/@fortawesome/fontawesome-free@6.2.1/css/fontawesome.min.css">
    <link rel="stylesheet" type="text/css"
        href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
    <link rel="stylesheet" type="text/css"
        href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/5.3.0/css/bootstrap.min.css">
    <link rel="stylesheet" type="text/css"
        href="https://cdn.datatables.net/v/bs5/dt-1.13.6/b-2.4.2/b-colvis-2.4.2/b-html5-2.4.2/sc-2.2.0/sl-1.7.0/datatables.min.css">


    <script src="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/5.3.0/js/bootstrap.bundle.min.js"></script>
    <script
        src="https://cdn.datatables.net/v/bs5/dt-1.13.6/b-2.4.2/b-colvis-2.4.2/b-html5-2.4.2/sc-2.2.0/sl-1.7.0/datatables.min.js">  </script>
    <link
        href="https://cdn.datatables.net/v/dt/jszip-3.10.1/dt-1.13.6/af-2.6.0/b-2.4.2/b-colvis-2.4.2/b-html5-2.4.2/b-print-2.4.2/fh-3.4.0/r-2.5.0/rg-1.4.1/sc-2.2.0/sp-2.2.0/sl-1.7.0/sr-1.3.0/datatables.min.css"
        rel="stylesheet">

    <script src="https://cdnjs.cloudflare.com/ajax/libs/pdfmake/0.2.7/pdfmake.min.js"></script>
    <script src="https://cdnjs.cloudflare.com/ajax/libs/pdfmake/0.2.7/vfs_fonts.js"></script>
    <script
       ...

JavaScript

<script>

  document.addEventListener( 'DOMContentLoaded', function(){  
    
    $('.spinner-border').hide();
    google.script.run.withSuccessHandler (data => {
                  var passcode = data[0];
                  var passcodeURL = data[1] ;
                  document.getElementById("link1").setAttribute("href",passcodeURL);
                  document.getElementById("link2").setAttribute("href",passcodeURL);   
                  // document.getElementById("link3").setAttribute("href",passcodeURL);                 
                  }
    ).withFailureHandler(er => {ShowToast ("Error in fetching passcode post URL, Contact Developer", "error")}).GetpasscodeData();
    $('#exampleModal').modal('show');

});

//--
function sheetQuestionCount() {
      let currentDate = new Date();
      // console.log('called at '+ currentDate);

   google.script.run.withSuccessHandler (data => {
                  var questionCount = data;
                  // console.log ( 'question count: '+ questionCount) ;
                  document.getElementById('badgeCountId').innerHTML = questionCount;              
                  }
    ).withFailureHandler(er => {ShowToast ("Error in fetching Question Count, Contact Developer", "error")}).getSheetQuestionCount();

}
var interval = setInterval(sheetQuestionCount, 120000);

//---
function submitPasscode() {
        let passcodeInput = document.getElementById('passcodeSubmitted');

        $('.spinner-border').show();
            google.script.run.withSuccessHandler (data => {
              var passcode = data[0];
              var passcodeURL = data[1] ;
              var scriptURL = data[2]+ "?v=Index" ;
             if (passcodeInput.value == passcode) {
                   $('.spinner-border').hide(); 
                   // window.self.location.href = scriptURL;
                  google.script.run.withSuccessHandler( returnValue =>
                      {
                          $('.spinner-border').hide();
                    ...