title: Avoid repeating myself
body: <p>I'm sure there is a way to write a shorter version of the following js code. In the end I'm just repeating myself over and over again. Any suggestions?</p>
  <p>Thanks a lot!</p>
  <pre><code>if (designVal == 0 &amp;&amp; colorVal == 0) {
      design01yellow.style.display = &quot;block&quot;;
      design01black.style.display = &quot;none&quot;;
      design01blue.style.display = &quot;none&quot;;
      design01grey.style.display = &quot;none&quot;;
      design02yellow.style.display = &quot;none&quot;;
      design02black.style.display = &quot;none&quot;;
      design02blue.style.display = &quot;none&quot;;
      design02grey.style.display = &quot;none&quot;;
      design03yellow.style.display = &quot;none&quot;;
      design03black.style.display = &quot;none&quot;;
      design03blue.style.display = &quot;none&quot;;
      design03grey.style.display = &quot;none&quot;;
  } else if (designVal == 0 &amp;&amp; colorVal == 1) {
      design01yellow.style.display = &quot;none&quot;;
      design01black.style.display = &quot;block&quot;;
      design01blue.style.display = &quot;none&quot;;
      design01grey.style.display = &quot;none&quot;;
      design02yellow.style.display = &quot;none&quot;;
      design02black.style.display = &quot;none&quot;;
      design02blue.style.display = &quot;none&quot;;
      design02grey.style.display = &quot;none&quot;;
      design03yellow.style.display = &quot;none&quot;;
      design03black.style.display = &quot;none&quot;;
      design03blue.style.display = &quot;none&quot;;
      design03grey.style.display = &quot;none&quot;;
  } else if (designVal == 0 &amp;&amp; colorVal == 2) {
      design01yellow.style.display = &quot;none&quot;;
      design01black.style.display = &quot;none&quot;;
      design01blue.style.display = &quot;block&quot;;
      design01grey.style.display = &quot;none&quot;;
      design02yellow.style.display = &quot;none&quot;;
      design02black.style.display = &quot;none&quot;;
      design02blue.style.display = &quot;none&quot;;
      design02grey.style.display = &quot;none&quot;;
      design03yellow.style.display = &quot;none&quot;;
      design03black.style.display = &quot;none&quot;;
      design03blue.style.display = &quot;none&quot;;
      design03grey.style.display = &quot;none&quot;;
  } else if 
  ///AND SO ON
  </code></pre>