title: jquery array .val()
body: <p>I have this code below...</p>
  
  <pre><code>if (x == 0) {
              $("#scenariotitle").val('');
              $("#scenariosuffix").val('');
  }
  </code></pre>
  
  <p>...which works fine. However, that list will grow to about 5 more jquery selects. </p>
  
  <p>Is there a way to store them into an array and then use the .val('') function on all the elements in the array? If that is possible, will it be more efficient? Should I just stick to listing them out individually if the list is not greater than 10?</p>
  
  <p>EDIT: I have decided to use this...</p>
  
  <pre><code>$("#scenariotitle, #scenariosuffix, #scenariosuffix, #scenariosuffix").val("");
  </code></pre>
  
  <p>...which is why I accepted the answer below. <strong>However</strong>, there is a very good discussion in the comments, and other answers provided, on how to properly use a jquery array selector.</p>