title: Javascript variables in HTML attributes
body: <p>I know there are a lot of posts about this, but I can't find an answer to my specific problem.</p>
  <p>I would like to make a JS variable the value of an HTML attribute:</p>
  <pre><code>&lt;script&gt; var screenWidth = screen.width &lt;/script&gt; 
  
  &lt;img src=&quot;images/title.png&quot; width=&quot;VARIABLE HERE&quot; style=&quot;margin-top: 3%&quot;`
  </code></pre>
  <p><code>&quot;VARIABLE HERE&quot;</code> is where I would want the <code>screenWidth</code> variable to go. What is the best of going about this?</p>