jQuery - Display content from select menu (more general approach)
<p>I've seen similar solutions here but they are too specific. My case requires a more general approach to the solution. Basically something that can be reused regardless of the classes used in the displaying DIVs.</p>

<p>Side note: I'm not too good a jQuery or JavaScript, working on it.</p>

<p><strong>My HTML code</strong></p>

<pre><code>&lt;select name="business-law" id="business-law" class="filter"&gt;
  &lt;option value="view-all"&gt;&amp;mdash; View All&lt;/option&gt;
  &lt;option value="firm-name"&gt;Firm name 1&lt;/option&gt;
  &lt;option value="other-firm"&gt;Firm name 2&lt;/option&gt;
  &lt;option value="another-one"&gt;Firm name 3&lt;/option&gt;
  &lt;option value="final-firm-name"&gt;Firm name 4&lt;/option&gt;
&lt;/select&gt;

&lt;div class="firm-name"&gt;Author 1 info&lt;/div&gt;
&lt;div class="firm-name"&gt;Author 2 info&lt;/div&gt;
&lt;div class="other-firm"&gt;Author 3 info&lt;/div&gt;
&lt;div class="another-one"&gt;Author 4 info&lt;/div&gt;
&lt;div class="final-firm-name"&gt;Author 5 info&lt;/div&gt;
&lt;div class="final-firm-name"&gt;Author 6 info&lt;/div&gt;
</code></pre>

<p><strong>My case</strong></p>

<p>I'm building a page that lists law firm authors. There are many authors in the list, and many of them belong to the same law firm.</p>

<p><strong>My problem</strong></p>

<p>Since the page can have a lot of authors, I need to implement a 'filter' feature. The filter will filter by firm. So the visitor selects one of the firms from the select menu, and only the authors that work for that firm should be displayed. The others should hide.</p>

<p>There's also a 'View All' option, this obviously, will show every author on the page. This is the default option.</p>

<p><strong>My question</strong></p>

<p>Any idea how to accomplish this with code that's reusable in similar cases? (Maybe to filter countries, or languages, or fruits, you know what I mean).</p>

<p>While looking at other solutions here, I found <a href="http://stackoverflow.com/questions/10132331/on-change-the-select-value-display-certain-div-content">this one</a>, but it's too specific to his case. It's also a little over my head so I don't know how to adapt it to this case.</p>

<p>Thanks in advance.</p>
