Home/Jquery/How to get the top and left positon of clicked td/div

How to get the top and left positon of clicked td/div

How to  get the  top and left positon of clicked td/div

Jquery

$(document).on(“click”, “#tbUserDetails”, function()
{
var getclickTop = $(this).offset().top;
var getclickLeft = $(this).offset().left;
}

Explanation:
.on method is used for dynamically created table using jquery (at runtime)

HTML

<table>
<tr>
<td id=’tbUserDetails’></td>
</tr>
</table>

Leave A Comment