How to assign dynamic element id in jQuery when onMouseOver in a href tag?
<p>I have 3 hyperlinks and DIV randomly generated by PHP script with dynamic ids. For example,</p>

<pre><code>&lt;a href="http://www.example.com/find.php?id=xy1" id="xy1" onMouseover="analyze('final', 'xy1')"&gt;xy1&lt;/a&gt;
&lt;a href="http://www.example.com/find.php?id=ay2" id="ay2" onMouseover="analyze('final', 'ay2')"&gt;ay2&lt;/a&gt;
&lt;a href="http://www.example.com/find.php?id=am3" id="am3" onMouseover="analyze('final', 'am3')"&gt;am3&lt;/a&gt;

&lt;div id="xy1"&gt;&lt;/div&gt;
&lt;div id="ay2"&gt;&lt;/div&gt;
&lt;div id="am3"&gt;&lt;/div&gt;
</code></pre>

<p>I want to display some text based on the <code>onMouseover</code> event through a function <code>analyze()</code> in jQuery. For example,</p>

<pre><code>function analyze(db, target) {
  jQuery.ajax({
    type: "GET",
    url:  "toThumb.php",
    data: 'db=' + db + '&amp;id=' + target,
    success: function(output){ $("#"+target).html(output); }
  });
}
</code></pre>

<p>Here, the element id <code>#xy1</code> must be automatically assigned based on <code>onMouseover</code> event. Like <strong>xy1</strong> as a value of a variable name. Maybe on the next <code>onMouseover</code> event it will be <strong>ay2</strong> or <strong>am3</strong>.</p>

<p>I tried to set with <code>$("#"+target).html(output);</code> It failed... If I test individually with <code>$("#xy1").html(output);</code> OR <code>$("#ay2").html(output);</code> OR <code>$("#am3").html(output);</code> It works fine.</p>

<p>Does my way of coding is wrong? Or, Can I use <code>this</code> instead of passing parameters?</p>