title: Javascript change css(“width”)?
body: <pre><code>if(document.getElementById("gal").style.width = 513) {
      document.getElementById("gal").style.width = "25%";
      document.getElementById("gal").style.height = "auto";
  }
  </code></pre>
  
  <p>I'm trying to change default width for certain image width added on Gallery.</p>
  
  <p>This code perfectly work, the problem is that getelementbyid changed just the first element of the gallery.</p>
  
  <p>How can i do the same, using getelementsbyclassname?
  Or are there any other way to change all of the id's style?</p>
  
  <p>Thanks in advance.</p>