View Full Version : Changing A attributes onclick event via dom

04-10-2006, 05:23 PM
Is there a way to change just the onClick action via the dom or do you have to change the entire element like:

createElement("<a href='#' onClick=\"methodName(" + action + ")\">text</a>");

Cheers, :thumbsup:

Bill Posters
04-10-2006, 05:40 PM
DOM 0…

Presuming the value of action var has been set prior to this instruction…

obj.onclick = function() { methodName(action) }

04-11-2006, 12:29 PM
worked a charm, thanks! :p

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum