title: Set the div id dynamically to a variable and use it for hover in jquery
body: <p>I'm new to this .Net and I need to get the <code>div</code> <code>id</code> dynamically to set it to a variable and use it later when hovering.</p>
  
  <p>In my case I have 4 <code>div</code> elements namely <code>div1</code>, <code>div2</code>, <code>div3</code>, <code>div4</code> and inside those divs I have four images with id <code>pic1</code>, <code>pic2</code>, <code>pic3</code>, <code>pic4</code>. So when I hover on any one of those the image inside that div should animate.</p>
  
  <p>How can I get the div id in a variable when hovering and use that to animate that specific image. </p>
  
  <p>Here is the code I've tried so far:</p>
  
  <pre><code>$(document).ready(function() { 
      $("#div1").hover(function() { 
          $("#pic1").animate({ width: '150px', height: '150px' }); 
      }); 
      $("#div2").hover(function() { 
          $("#pic2").animate({ width: '150px', height: '150px' }); 
      }); 
  });
  </code></pre>
  
  <p>Please can any one help me to find a solution for this.</p>