Expand my Community achievements bar.

Don’t miss the AEM Skill Exchange in SF on Nov 14—hear from industry leaders, learn best practices, and enhance your AEM strategy with practical tips.
SOLVED

click event using data attribute

Avatar

Level 5

Hi all,

 

keerthana_hn_0-1623677334328.png

<td class="cmp-modal-downloads__col--action" data-asset-share-id="download-archive" data-asset-share-download-id="61a36495-c979-4900-95a4-08d9a2e0f506">

 

<a href="page link" class="ui positive primary right labeled icon button">
Download
<i class="download icon"></i>
</a>
</td>

 

how to do click event using "data-asset-share-id" attribute of download button which is inside table tag so that I can use other values which is inside td tag?

 

1 Accepted Solution

Avatar

Correct answer by
Community Advisor

Try this selector

$("[data-asset-share-id='download-archive']") to get the click event on attribute

View solution in original post

4 Replies

Avatar

Correct answer by
Community Advisor

Try this selector

$("[data-asset-share-id='download-archive']") to get the click event on attribute

Avatar

Level 5

@Varun_Shakya I have used this selector but still click event isn't happening.

Avatar

Community Advisor
Try these selectors $("td[data-asset-share-id='download-archive']") or $("tr").on("click","td[data-asset-share-id='download-archive']")