JSFiddle - React, Tailwind, and code Playground

by Ritesh Kashyap

HTML

<input type="text" id="txtName" value="TestData">
<button onclick="getvalue()">Log Name</button>

JavaScript

function GetValueofField(fieldName)
    {
        return document.getElementById(fieldName).value;
    }
var LastName = GetValueofField("txtName");