Calling workflow from mouse click on hyperlink in Rich Text Element

I have a requirement to show more details when an a hyper link is clicked in Rich Text Element. I am able to create the hyperlink. Now when I click the link in the rich text element it open a new tab in the browser. I am using toolkit and have written JS function to capture event:

document.getElementById(“RT_Metadata_Base”).addEventListener(“click”, function(event)
{
if (event.target.tagName === “A”) {

    const clickedWord = event.target.innerText; // Get the word text

	console.log("Clicked word: ", clickedWord); //Log for debugging

	bubble_fn_text_clicked(clickedWord); // Pass the word to Bubble

}

});

I have tried by linking JS with page as well as group element and also within the workflow while I tried calling workflow.

Somehow the mouse click is not getting captured. Can you please help. Any suggestions are welcome.

This topic was automatically closed after 70 days. New replies are no longer allowed.