Title: Set hidden input value without modifying the attribute
Tags: javascript;html;forms
Question: So many years in web development and still learning.
Is there any way to modify an input element  of type hidden's value without modifying the html attribute? As if the user entered a value. I need to be able to set a value but then upon calling form.reset() to return to the original value.
Notice: I'm not looking for a workaround, I want to know how to do the thing I asked for in particular.
Comment: This https://jsfiddle.net/khrismuc/m4bn7ax3/ works for me, both in Firefox and Chrome.

Comment: @php_nub_qq Right, in that case I guess the only solution *is* a workaround. For reference: https://stackoverflow.com/questions/2559616/javascript-true-form-reset-for-hidden-fields

Comment: really dont understand what u want

Comment: Try with `` instead of ``

Comment: what do you mean the original value?  Is this a value that a user set prior, or another value that you set as a default?

Comment: @Berdesdan there is a value attribute that is set *originally*, I want to modify the value but then by calling `form.reset()` to go back to that value.

Comment: @ChrisG you are correct, it appears the behavior I'm describing only concerns hidden inputs https://jsfiddle.net/m4bn7ax3/1/

Comment: reset() should set the original value

Here is the accepted answer: No way to do it properly
https://jsfiddle.net/m4bn7ax3/1/
What if you hide an input text? May it be an acceptable workaround?
<input type="text" style="display: none" name="foo" value="original"&gt;

Here is another answer: you can use javascript to set the input field value. Initialise the default value in a variable and then plug that into the input by setting the input field value to that variable in your form.reset() method.
document.getElementById("idOfInputField").value = defaultValue;
Comment for this answer: I don't know why this is downvoted. As far as I'm concerned, this is not updating the HTML element.
Comment for this answer: @MatiasCicero It does, at least in chrome. FYI  I didn't downvote.

{'source': 'StackExchangeDataset', 'subset': 'stackoverflow.com', 'metadata': {'AnswerCount': 2, 'CommentCount': 8, 'ContentLicense': 'CC BY-SA 3.0', 'CreationDate': '2017:00:11/30/17', 'FavoriteCount': None, 'PostTypeId': 1, 'Tags': '<javascript><html><forms>', 'Title': 'Set hidden input value without modifying the attribute', 'ViewCount': 120, 'id': 47563843, 'user_AboutMe': "<p>There are 10 types of people in the world, those who understand binary and those who don't.</p>\n", 'user_AccountId': 2808568.0, 'user_DisplayName': 'php_nub_qq', 'user_Reputation': 14209.0, 'user_Views': 9065.0, 'user_id': 2415293.0}}