JSFiddle - React, Tailwind, and code Playground

HTML

<form action="" method="get" id='form1'>

<input type="text" name="search" id="search" />
<input type="button" value="submit" onclick="convert()" />
</form >

JavaScript

function convert() 
{
    alert("hi");
    var str ;
    str = document.getElementById("search");
    str.value = (str.value.toLowerCase());
    var form = document.getElementById("form1");
    form.submit();
}