Skip to Main Content

APEX

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

How to get id of an element

2722891Nov 6 2014 — edited Nov 7 2014

Hi all,

My system is, Oracle 12g, Apex 4.2, Theme 25.

I have a display only item whose source is PL/SQL.

In the pl/sql code, I have code something like

for rec_name in cursor_name

loop

........

htp.p( '<a href="" onclick="return false;" class="print-link" id=" '|| rec_name.pk_id ||' " value=" '|| rec_name.pk_id ||' "> Print </a></div>' );

.......

end loop;

It displays many records of href link Print. The user will click on any Print link. Now in dynamic action, I wish to capture the clicked link's id or value to do further javascript processing. How can I capture the id / value. I tried following, but nothing worked.

var capturedId = this.attr('id');

var capturedId = $(this).attr('id');

var capturedId = document.getElementById($("a#id"));

Any other way please ?

This post has been answered by JimmyOTNC on Nov 6 2014
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Dec 5 2014
Added on Nov 6 2014
3 comments
1,855 views