title: How do I use selectors to get different variable for ifs?
body: <p>I'm working on a tool for my job to auto generate task comments to streamline agent workflow. I'm trying to use a selector to differentiate between ticket types and generate a comment string accordingly.</p>
  <p>The problem I'm running into is I can't seem to get the page to tell the the selector has changed, and it will only give the if condition and ignore the else.</p>
  <p>I'm certain I'm missing something simple but can't seem to figure it out.</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;!DOCTYPE html&gt;
  &lt;html&gt;
  
  &lt;body&gt;
    Select Ticket Type:
    &lt;label name="ticket" id="ticket"&gt;&lt;/label&gt;
    &lt;select name="ticket" id="ticket"&gt;
      &lt;option value="1"&gt;SMB&lt;/option&gt;
      &lt;option value="2"&gt;Complete&lt;/option&gt;
    &lt;/select&gt;
  
    &lt;input type="text" id="ticketgen" placeholder="EnterTicket number" maxlength="8"&gt;
    &lt;input type="button" id="tickgen" value="Generate"&gt;
    &lt;p id="output"&gt;&lt;/p&gt;
  &lt;/body&gt;
  
  
  &lt;script&gt;
    const txt1 = document.getElementById('ticketgen');
    const btn1 = document.getElementById('tickgen');
    const out1 = document.getElementById('output');
  
    function fun1() {
      var tick = document.getElementById('ticket');
      var today = new Date();
      var date = (today.getMonth() + 1) + '-' + today.getDate() + '-' + today.getFullYear();
      var time = today.getHours() + ':' + today.getMinutes();
      var dateTime = date + ' ' + time;
      setInterval(1000);
  
      if (tick = 1) {
        out1.innerHTML = "Correspondence:" + ' ' + dateTime + ' ' + txt1.value + ' ' + "SMB Correspondence";
      } else {
        out1.innerHTML = "Correspondence:" + ' ' + dateTime + ' ' + txt1.value + ' ' + "# attempt, contacted CX @";
      }
    }
  
  
  
    btn1.addEventListener('click', fun1);
  &lt;/script&gt;
  
  
  
  &lt;/html&gt;</code></pre>
  </div>
  </div>
  </p>