How to know which HTML element is clicked using javascript and get its ID?
I have displayed 3 labels dynamically using PHP for pagination- Page 1 , 2, 3 ,
<label id="<?php echo 'labelofpagination'.$z; ?>" value="<?php echo $z; ?>" >
<a href=# onclick="paginationlabelclicked(); "><?php echo $z; ?>
</a>
</label>
Now i want that if 1 is clicked then 1-10 records are displayed , if 2 , then 11-20 and so on.For this i would run a MySQL query accordingly.
But how do i get the ID ,
try pass this to handler
and then you can access id by using
UPDATE
In order that to be working you have assign id to anchor
and then you can access id by using