[thelist] setAttribute(someevent) in IE?

sbeam sbeam at syxyz.net
Tue Jun 1 12:04:45 CDT 2004


Folks:
the following code works as expected in Moz but does nothing in Opera 
and IE. Anyone know how to acheive this?
===
<a id="thelink" href="#">Click Me</a>
<script type="text/javascript">
    document.getElementById('thelink').setAttribute('onclick', 'foo()');

    function foo() {
        alert('foo');
    }
</script>
===

thanks!
-- 

# S Beam - Web App Dev Servs
# http://www.onsetcorps.net/


More information about the thelist mailing list