I dynamically generate a column of divs which are essentially "approve
item" buttons depending on the number of items that are returned from
the db.  I also have a separate div which is I'm trying to use jQuery
to trigger the mousedown of all of the approve buttons in the column
mentioned above.  So if I had say 4 buttons in my column I would have:

<div id="container">
  <div id="approveBtn" class="button grey"
onmousedown="markApproved('<?=$obj['id']?>')">Approve</div>
  <div id="approveBtn" class="button grey"
onmousedown="markApproved('<?=$obj['id']?>')">Approve</div>
  <div id="approveBtn" class="button grey"
onmousedown="markApproved('<?=$obj['id']?>')">Approve</div>
  <div id="approveBtn" class="button grey"
onmousedown="markApproved('<?=$obj['id']?>')">Approve</div>
</div>

<div id="approveAllChangesBtn" class="qfbutton green"
style="float:right;" onmousedown="approveAllChanges()">APPROVE ALL</
div>

Here's the jQuery line I have in the approveAllChanges() function in
that approve all button:

$('#container .button.grey').trigger('mousedown');

My problem is that the above code will only trigger the mousedown of
the first approve div layer and ignore the rest.  What do I need to do
to have it trigger the mousedown of all of them?

Thanks,
Sufian

Reply via email to