Sure, attached to this comment will be the code snippet that I am trying and the error I get.
main.html:
content.php:
You cannot use elgg_register_action as it's.
Learn how to register action in Elgg.
So you should get a link to action that you can use in your code even if you use JS for this.
Learn how to use an action in JS.
info@elgg.org
Security issues should be reported to security@elgg.org!
©2014 the Elgg Foundation
Elgg is a registered trademark of Thematic Networks.
Cover image by RaĆ¼l Utrera is used under Creative Commons license.
Icons by Flaticon and FontAwesome.