title: How do I acces a variable in html from a javascript file
body: <p>Hi I am working on a project and am using express and socketio to construct a website. When I get to index.ejs I get a variable called LocalName that I wish to use in a javascript file linked to index.ejs.</p>
  <p>This code is used when creating the variable:</p>
  <pre><code>app.get('/', checkAuthenticated, (req, res) =&gt; {
      res.render('index.ejs', { LocalName: req.user.name })
  })
  </code></pre>
  <p>This is what I wish to do with the variable:</p>
  <pre><code>const messageInput = document.getElementById('message-input')
  const message = string(LocalName) + &quot;: &quot; + string(messageInput.value)
  </code></pre>
  <p>I have tried using getelementbyBLANK but it does not work.</p>