title: Combine two jQuery functions new
body: <p>Please help me to combine two scripts of jquery. AT the moment they are not compatible to each other. What can I do to make them both friendly. <br><br>
  Jquery:</p>
  
  <pre><code>&lt;script&gt;
  function edit_product() {
  var id = $('.DIVY.panel3').attr('id');
  alert (id);
  &lt;/script&gt;
  
  &lt;script&gt;
    $(function(){
  
      $('.DIVY').click(function(){
          $('.DIVY.panel3').removeClass('panel3').addClass('panel2'); 
          $(this).removeClass('panel2').addClass('panel3'); 
      })
  })
  &lt;/script&gt;
  </code></pre>
  
  <p>html:</p>
  
  <pre><code>&lt;div id="1" class="DIVY panel2" &gt;click me please!&lt;/div&gt;
  &lt;div id="2" class="DIVY panel2" &gt;click me please!&lt;/div&gt;
  &lt;div id="3" class="DIVY panel3" &gt;click me please!&lt;/div&gt;
  &lt;div id="4" class="DIVY panel2" &gt;click me please!&lt;/div&gt;
  
  &lt;div &gt;&lt;a href="#" onclick="edit_product()"&gt;Check ID&lt;/a&gt;&lt;/div&gt;
  </code></pre>
  
  <p>For better visualization, I put this code to <a href="http://jsfiddle.net/sirgenius/CevcR/1/" rel="nofollow">My_jsfiddle</a> <br>
  Thank you for your efforts!</p>