# Canceling onclick for link\_to\_remote within div

**URL:** <https://www.ruby-forum.com/t/canceling-onclick-for-link-to-remote-within-div/175930>\
**Category:** Rails\
**Created:** [September 23, 2009, 12:33am UTC](https://www.ruby-forum.com/t/canceling-onclick-for-link-to-remote-within-div/175930 "2009-09-23T00:33:21Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![david](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/aeb1de/32.png) [@david](https://www.ruby-forum.com/u/david)\
**Post date:** [September 23, 2009, 12:33am UTC](https://www.ruby-forum.com/t/canceling-onclick-for-link-to-remote-within-div/175930/1 "2009-09-23T00:33:21Z")

</div>

If i have a div with an onclick event and a link\_to\_remote within this  
div, is there a way to cancel the onclick event when the link is  
clicked? I know one way is to cancel the event propigation with  
something like Event.stop, but I’m unsure where to include this. Is  
there a way to add an onclick event to link\_to\_remote? Thanks.
