JSFiddle - React, Tailwind, and code Playground

HTML

<form>
    <input type="hidden" name="my_hidden" value="Hidden Field" />
    <input type="text"   name="my_text"   value="Text Field"   />
</form>

JavaScript

$().ready(function() {
    $('input[name=my_hidden]').val('Hello Hidden Field');

    $('input[name=my_text]').val('Hello Text Field');

    // Though the DOM is updated with the new values. The variable temp
    // does not reflect the changes to the input text field, but works
    // for the hidden field. When in IE, temp reflects the changes
    // in both fields.
    var temp = $('form').html();
    alert(temp);
});