JSFiddle - React, Tailwind, and code Playground

HTML

<form>
   <input type="url" name="someUrl" onkeyup="checkUR(this)" >
</form>

JavaScript

function checkUR(abc){
    string = abc.value
    if(!(/^http:\/\//.test(string))){
        string = "http://" + string;
    }
    abc.value=string
}