title: How to change the style of an element when a specific class is present?
body: <p>There's an idea to set a value to the "div" with an id if there is another class in HTML code. I am currently studying JS and I've faced a problem that this simple code doesn't work.</p>
  
  <pre><code>function change_visibility() {
      if (document.getElementsByClassName('mobile')) {
          document.getElementById('#cube').style.width = '10px';
      }
  }
  </code></pre>