title: how to use url parameters in html?
body: <p>I get URL parameters using Javascript but i can't use those variables in my html.
  the JS code is this:<br></p>
  
  <pre><code>&lt;script&gt;
  var url_string = window.location.href; //window.location.href
  var url = new URL(url_string);
  var c = url.searchParams.get("name");
  console.log(c);
  &lt;/script&gt;
  </code></pre>
  
  <p>and my URL is <code>localhost:8000/something?name=ABC</code>.here i can get the value of name and show it in the browser console but when i try to set the value of an input tag in my HTML it doesn't do it and raises some errors.
  my JS and html is like:</p>
  
  <pre><code>&lt;script&gt;
      var url_string = window.location.href; //window.location.href
      var url = new URL(url_string);
      var c = url.searchParams.get("name");
      document.getElementById("user").value =url.searchParams.get("name");
      &lt;/script&gt;
  &lt;input id="user" value""&gt;
  </code></pre>
  
  <p>this should have changed the value of the input tag but doesn't.<br></p>