title: Trying to verify credit card number but showing a TypeError
body: <p>I have a feeling that I'm getting '<strong>TypeError: cardLogo.setAttribute is not a function'</strong> because I'm using the 'document.getElementsByClassName' instead of 'document.getElementsById'. Could that be the reason for my error or is there something else I'm missing?</p>
  <p>What I want it to do is that when a number is inputted it verifies the card type (visa, mastercard, etc.) but I keep getting this error.</p>
  <pre><code>var cardNumber = new Cleave('.card-number-input', {
      creditCard: true,
      delimiter: &quot; &quot;,
      onCreditCardTypeChanged: function (type) {
          const cardLogo = document.getElementsByClassName('front-logo'),
          visa = 'fa-brands fa-cc-visa';
  
  
          switch (type) {
              case &quot;visa&quot;:
                  cardLogo.setAttribute(&quot;class&quot;, visa);
                  break;
          
              default: 
              cardLogo.setAttribute(&quot;class&quot;, ' ');
              break;
          }
      }
  });
  </code></pre>