Is it good practice to include other dom elements actions into another dom elements action like common actions for both in javascript
<p>Is it good practice code below?(jquery)</p>

<p>common.js (dom elements of two files written in same js action)</p>

<pre><code>$('.list_item').click(function () {
   $('#yes_button').addClass('selected');
   $('#no_button').addClass('selected_no');
});
</code></pre>

<p>yes_button.html</p>

<pre><code>&lt;div class='list_item yes_class' &gt; Muhammad s.a.w &lt;/div&gt;
&lt;div id='yes_button' &gt; Yes &lt;/div&gt;
</code></pre>

<p>no_button.html</p>

<pre><code>&lt;div class='list_item no_class'&gt; Muhammad s.a.w &lt;/div&gt;
&lt;div id='no_button' &gt; No &lt;/div&gt;
</code></pre>

<p>is the above practice good or should we write like below</p>

<pre><code>$('.yes_class').click(function () {
   $('#yes_button').addClass('selected');
});

$('.no_class').click(function () {
   $('#no_button').addClass('selected_no');
});
</code></pre>

<p>I have two files with same class for DOM elements, I'm writing JS code based on unique 
class name, my question is it the good practice to follow such way.</p>
