JSFiddle - React, Tailwind, and code Playground

HTML

<html>
 <body>
  <form onsubmit="myFunction(event);">
   <input type="text" id = "txt" required >
    <button type="submit" id="btn">submit</button>
  </form>
  <ul id = "ul"></ul>
  <script>
   function myFunction(e){
   e.preventDefault(e);
   var inputValue = $('#txt').val();
   var arr = [];
   arr.push({name:inputValue})
   localStorage.setItem("key",arr);
   /* localStorage.setItem("key","<li><input  type='checkbox'/> <span>"+inputValue+"</span> <input type='button' value='Delete'/><input type='button' value='Update'/></li>"); */
   $('#ul').html(localStorage.getItem("key"));
   $('#txt').val("");
    }
</script>
</body>
</html>