title: apply Class OnChange in Javascript
body: <p>i m creating no of <code>&lt;li&gt;... &lt;/li&gt;</code> in javascript like this</p>
  
  <pre><code>$(function () {
      var settings = {
          rows: 6,
          cols: 6,
          rowCssPrefix: 'row-',
          colCssPrefix: 'col-',
          seatWidth: 30,
          seatHeight: 30,
          seatCss: 'seat',
          selectedSeatCss: 'selectedSeat',
          selectingSeatCss: 'selectingSeat'
      };
  
      var init = function (reservedSeat) {
          var str = [], seatNo, className;
          for (i = 0; i &lt; settings.rows; i++) {
              for (j = 0; j &lt; settings.cols; j++) {
  
                  seatNo = (i + j * settings.rows + 1);   
                  className = settings.seatCss + ' ' + settings.rowCssPrefix + i.toString() + ' ' + settings.colCssPrefix + j.toString(); 
                  str.push('&lt;li id="'+seatNo+'" class="' + className  +" table"+seatNo+ '"&gt;' +'&lt;a id="a'+ seatNo +'" title="'+ seatNo+'"&gt;&lt;/a&gt;' '&lt;/li&gt;');
              }
          }
          $('#place').html(str.join(''));
  
      };
  </code></pre>
  
  <p>Now i need to apply the Class <code>selectedSeat</code> to the <code>&lt;li&gt;</code>  ID's= 15 , 14 , 25, 10 </p>