Important Update: Archer Community Scheduled Maintenance on November 23–24 - New Community Launching Soon! Learn More..
2021-08-19 07:50 AM
in case of span id i created something like this which is working fine.
document.querySelector('#span_id').onclick =
function()
{
alert();
}
2021-08-19 07:56 AM
Or,
$('#span_id').click(function(){
alert();
});
Advisory Consultant
2021-08-19 08:07 AM - edited 2021-08-19 08:08 AM
thank you @DavidPetty but my ask is if there is no span id how it would be in that case.
element is something like this with out span id
<div class="readonly">
<span>test</span>
</div>
2021-08-19 08:20 AM
That gets a little trickier. You'd have to find an element that has an id or unique class and go from there.
Advisory Consultant
2021-08-24 12:48 PM
I have thoroughly inspected html tree in view and edit mode and found that only table id and table td class is same in both of the cases so i would need to use table id and td class to add click event.
this is not working:
2021-08-24 02:46 PM
You might be able to supply the index of .tdClass like below by putting the index number inside of the brackets.
(element).closest('td').find('.tdClass')[2].onclick =
function () {
alert("onclick");
}
Advisory Consultant