不知道是不是你要的意思?<input id="i1" onblur="f()"/>
<input id="i2" onblur="f()"/>
<input id="i3" onblur="f()"/><script>
function f() {
a = document.activeElement;
alert(a.id?a.id:a.tagName);
}
</script>

解决方案 »

  1.   

    BlueDestiny(never-online, come back to cpp)是这个意思, 我是主要是想知道在FF里怎样实现
      

  2.   

    try
    <script type="text/javascript">
    if (typeof document.activeElement == 'undefined')
    {
        document.activeElement = null;
        var x = document.getElementsByTagName('*');
        for ( var i = 0 ; i < allTags.length; i++ )
        x[i].onfocus = function() { document.activeElement = this;}
    }
    function f() {
      var a = document.activeElement;
      document.getElementById("demo").innerHTML=(a.id?a.id:a.tagName);
    }
    </script>