Something like this should work, assuming you want it to apply to only
those 2 elements.

$(document).ready(function()
{
   $('#one, #two').click(function()
   {
      var id = $(this).attr('id');
      alert(id + ' was clicked.');
   }
}
);

On Mar 24, 5:28 am, "Scottus " <[EMAIL PROTECTED]> wrote:
> i have page
>
> <div  id="one">  click one</div>
>
> <div  id="two">  click one</div>
>
> i want a script in the header to be able to report the ID of the div
> that I clicked on.
>
> _______________________________________________
> jQuery mailing list
> [EMAIL PROTECTED]://jquery.com/discuss/


_______________________________________________
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/

Reply via email to