<!DOCTYPE html>
<html>
<head>
<script type='text/javascript'>
window.onload=function(){
window.something = function(){
console.log('global');
}
HTMLElement.prototype.something = function(){
console.log('element');
}
}
</script>
</head>
<body>
<a onclick="something();">Click Me</a>
<br>
<a onclick="this.something();">And Me</a>
<br>
<a onclick="window.something();">Now Me</a>
</body>
</html>