JSFiddle - React, Tailwind, and code Playground

HTML

<input name="test" value="Hello world" id="test" /></br>
<button onclick="alertValue();">Alert value - jquery</button></br>
<button onclick="alertHtml();">input object to console - jquery</button></br>
<button onclick="alertValueJS();">Alert value - js</button>

JavaScript

function alertValue(){
    var value = $("#test").val();
    alert(value);
}
function alertHtml(){
    var html = $("#test");
    console.log(html);
    alert("Console!!!");
}
function alertValueJS(){  
    var oldVal = document.getElementById("test").value;
    alert(oldVal);
}