JSFiddle - React, Tailwind, and code Playground

by Alex Cowan

JavaScript

var windowLoc = $(location).attr('pathname');


if (windowLoc == '/severity/') {
  console.log('it is /severity/');
  jQuery(document).ready(function($) {

    $('#severity-button').click(function() {
      //saving the user inputted severity, which will later be used as a URL param when calculating 
      //symptom severity
      var text = document.getElementById("text_entered").value;
      localStorage.setItem('severity_text', text);
      console.log(text);
    });
  });
} else {
  console.log('it is not /severity/');
}