javascript set attribute onclick before href code example Example: href before onclick js <a href="" onclick="javascript:triggerMe();return false;">click</a>