title: How to get update the values of html file after executing the javascript?
body: <p>We get data dynamically from different sources and then javascript (say, data injector) update multiple controls with that data - controls like textboxes, dropdowns and checkboxes and some other which get updated data after executing the javascript. The html page view updates, showing correct values.</p>
  <p>We need to send final html to another system (say, end service) where javascripts cannot be executed. But the updates are not reflecting in the outerHtml. How can we force an update to DOM which reflects in Html, or how we can get the final html.</p>
  <p>We cannot make changes to data injector javascript to use attribute updates as suggested here - <a href="https://stackoverflow.com/questions/10346471/why-doesnt-the-value-attribute-of-the-input-change">Why doesn&#39;t the value attribute of the input change?</a> i.e.,
  <code>document.getElementById(&quot;p1&quot;).setAttribute(&quot;value&quot;, &quot;New text&quot;);</code>
  is not feasible</p>
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;html&gt;
  
  &lt;body&gt;
    &lt;h2&gt;JavaScript can Change HTML&lt;/h2&gt;
    &lt;input id="p1" value="initial" /&gt;
    &lt;p&gt;The paragraph above was changed by a script.&lt;/p&gt;
    &lt;script&gt;
      document.getElementById("p1").value = "New text"; //This works fine - injector js updates multiple controls - input, select, checkbox etc.
      console.log(document.getElementById("p1").value); //This shows updated value - page view is updated properly
  
      // TODO: Can we Force html refresh/update - how?? //
      console.log(document.getElementById("p1").outerHTML); //Issue is here, it shows old value. How to get full html with  all new values, expected by end service
    &lt;/script&gt;
  &lt;/body&gt;
  
  &lt;/html&gt;</code></pre>
  </div>
  </div>
  </p>
  <p>Actual value in outerHtml - <code>&lt;input id=&quot;p1&quot; value=&quot;initial&quot;&gt;</code></p>
  <p>Expected value by end service - <code>&lt;input id=&quot;p1&quot; value=&quot;New text&quot;&gt;</code></p>
  <p>We are not restricted to using outerHtml, if there is any other way to achieve the above requirement without making changes to data injector scripts.
  What can be done to obtain updated html for sending to the end service?</p>
  <p>How to get the updated values from the outerHTML after getting the values from javascript?</p>