JSFiddle - React, Tailwind, and code Playground

by thilakar

HTML

<input type = 'text' name = 'txt_comment' id="txt_comment">
<button onclick ="alertNow()" value="Submit">Submit</button>

JavaScript

function alertNow() {
  var a = document.getElementById("txt_comment").value;
 alert (a);
}