I want to run a function inside an object by onclick
, but it doesn't work.
Here is the code:
JSCode:
var jn = {
alertText: function(){
alert(arguments[0]);
}
};
HTML:
<a href="#" onclick="jn.alertText('hi')">[ClickHere]</a>
JSFiddle: http://jsfiddle.net/dotku/Nqh4S/2/