JSFiddle - React, Tailwind, and code Playground
HTML
<input type="text" value=" " id = "marks1" name = "marks1" onblur="myFunction('marks1')"/>
<script>
var myFunction = function myFunction( txtname ) {
alert("call");
var txtobj = document.getElementsByName(txtname);
alert("my value : "+txtobj[0].value);
}
</script>