JSFiddle - React, Tailwind, and code Playground

by appleboy

HTML

<input type="text" id="input-text" value="default" />
<button id="show">show prop and attr value</button>

JavaScript

var show = function () {
    console.log($("#input-text").attr('value'));
    console.log($("#input-text").prop('value'));
};
$(document).on('click', '#show', function(){
    show();
});