Victor Solanoy

photography & my take on stuff

Modifying the onClick value in javascript

with one comment

I was trying to figure out an easy way of changing the onclick value of a click-able element in a project I’m working on and found this solution — so incredibly simple, and it works in Safari, FF and IE…

document.getElementById(‘clickable-element-id’).onclick = function() {functionname(parameterlist);};

Written by Victor

August 24th, 2009 at 3:28 pm

Posted in Web

One Response to 'Modifying the onClick value in javascript'

Subscribe to comments with RSS or TrackBack to 'Modifying the onClick value in javascript'.

  1. Nerd.

    Nice (MT) badge by the way.

    Jon Victorino

    24 Aug 09 at 16:39

Leave a Reply