change onclick attribute javascript code example Example: Change onClick attribute of html tag $("#id").attr("onclick","new_function_name()");