<div id="test">Test</div> <script> document.getElementById( "test" ).onclick = handler.bind( { test: "test" } ); function handler() { alert( this.test ); }; </script>