JS Variable from Form Input <p>FYI: I have to use <code>data-label</code> as a selector for other reasons..</p> <p>I need to store values from a form to use later via js, so that when a user toggles a radio button the values will be re-inserted into the form inputs.</p> <p>How do I store the values, then re-insert them when the user clicks a radio button? Here's where I am at:</p> <pre><code>// user clicks initially, then the values would be stored.. $('[data-label="FrenchCheckbox"] [data-label="State1"] [data-label="Checkbox"] [data-label="Unchecked"]').click(function() { // want to store the initial value now!! // ..then translating the form inputs to another lang $('[data-label="Create StepWizard"] [data-label="CreateAssetInput"]').each(function(i, ele) { var tString = $(ele).val(); if(tString.length &lt;= 0) return; var tSrc = 'en'; var tDst = 'fr'; var key = 'my api key'; var tUrl = "https://www.googleapis.com/language/translate/v2?key=" + key + "&amp;source=" + tSrc + "&amp;target=" + tDst + "&amp;q=" + tString; $.get(tUrl, function(response) { $(ele).val(response.data.translations[0].translatedText); }); }); }); </code></pre> <p>Then when the user clicks the radio button (first line below) reinsert the initial values into the form fields?</p> <pre><code>$('[data-label="LanguageRadioButtons"] [data-label="French"] [data-label="Radio Button"] [data-label="Initial"] ').click(function() { // how do I reinsert the values from the initial input? }); </code></pre> <p>Thanks for your ideas!</p>