title: using getElementByClassName in Safari
body: <p>I'm trying to target <code>Safari(both mobile and desktop)</code> and append some styles for a class via <code>Javascript</code>. </p>
  
  <p>This is how my code looks like.</p>
  
  <pre><code>(function safaristyles()
  {
      if (navigator.userAgent.match(/AppleWebKit/) &amp;&amp; ! navigator.userAgent.match(/Chrome/)) {
          var avt = document.getElementsByClassName("avatar");
          avt.style.border = "0" + "px";
          avt.style.padding = "0" + "px";
      }
  })(this);
  </code></pre>
  
  <p>As I see it in <code>Webkit inspector</code>, this is the error I'm facing.</p>
  
  <p><strong>Type Issue -
  'undefined' is not an object (evaluating 'avt.style.border = "0" + "px")</strong></p>
  
  <p>I'm a beginner at JS stuff, so please bear with me.</p>