JSFiddle - React, Tailwind, and code Playground

HTML

<form name="form1" method="get">
    <input type="text" name="search" id="search" />
    <input type="submit" value="submit" onclick="convert();" />
</form >

JavaScript

function convert() {
    alert("hi");
    var str = document.form1.search.value.toLowerCase();
    document.writeln(str);
    console.log(str);
}