Possible Duplicate:
The current element as its Event function param
Would this work
<script type="text/javascript">
var foo = function(param)
{
param.innerHTML = "Not a button";
};
</script>
<button onclick="foo(this)" id="bar">Button</button>
rather than this?
<script type="text/javascript">
var foo = function()
{
document.getElementId("bar").innerHTML = "Not a button";
};
</script>
<button onclick="foo()" id="bar">Button</button>
And would the first method allow me to load the javascript from elsewhere to perform actions on any page element?