Add JS snippet for event.preventDefault().