title: I'm trying to run a jQuery code to change the h1 color based on whether it's a weekday or a weekend
body: <p>I'm trying to run a jQuery code to change the h1 color based on whether it's a weekday or a weekend
  The error I keep getting is 'ReferenceError: $ is not defined', can someone please help me?
  app.js is located in <em>parentfolder/app.js</em> while lists.ejs is located in <em>parentfolder/views/lists.ejs</em>
  . <em>document.queryselector</em> is not working either</p>
  <p><strong>app.js</strong></p>
  <pre><code>const express = require(&quot;express&quot;);
  const bodyPareser = require(&quot;body-parser&quot;);
  
  const app = express();
  
  app.use(bodyPareser.urlencoded({extended : true}));
  
  app.set(&quot;view engine&quot;, &quot;ejs&quot;);
  
  app.get(&quot;/&quot;, function(req, res) {
      var date = new Date();
      var currentDay = date.getDay();
  
      var days = [&quot;Sunday&quot;, &quot;Monday&quot;, &quot;Tuesday&quot;, &quot;Wednesday&quot;, &quot;Thursday&quot;, &quot;Friday&quot;, &quot;Saturday&quot;];
  
      if (currentDay === 0 || currentDay === 6) { 
          $(h1).style.color = &quot;red&quot;;
      } else {
          $(h1).style.color = &quot;blue&quot;;
      }
      res.render(&quot;lists&quot;, {today : days[currentDay]});
  
      res.sendFile(__dirname + &quot;/views/lists.ejs&quot;);
  });
  
  app.listen(&quot;3000&quot;, function() {
      console.log(&quot;Server started in 3000&quot;);
  });
  </code></pre>
  <p><strong>lists.ejs</strong></p>
  <pre><code>&lt;!DOCTYPE html&gt;
  &lt;html lang=&quot;en&quot;&gt;
  &lt;head&gt;
      &lt;meta charset=&quot;UTF-8&quot;&gt;
      &lt;meta http-equiv=&quot;X-UA-Compatible&quot; content=&quot;IE=edge&quot;&gt;
      &lt;meta name=&quot;viewport&quot; content=&quot;width=device-width, initial-scale=1.0&quot;&gt;
      &lt;title&gt;Document&lt;/title&gt;
  &lt;/head&gt;
  &lt;body&gt;
      &lt;h1&gt;Today is &lt;%= today %&gt;&lt;/h1&gt;
  
      &lt;script src=&quot;https://ajax.googleapis.com/ajax/libs/jquery/3.6.0/jquery.min.js&quot;&gt;&lt;/script&gt;
      &lt;script src=&quot;app.js&quot;&gt;&lt;/script&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>