哪里不明白呢,这是根据按键,然后按照table中的td进行定位

解决方案 »

  1.   

    这是方向键控制焦点的脚本:
    第一个问题:
    function setobj(input){ 
    obj=input; 

    这个方法中obj=input是什么意思?
    第二个问题:
    function init(){ 
    document.onkeydown=keyDown; 
    document.onkeyup=keyUp; 

    这个方法在什么时候执行,init()是javascript中的方法吗?
    第三个问题:
    key==116和key==8的是代表键盘的什么键?
    第四个问题:
    if(event.srcElement.tagName!="INPUT"){ 
    event.cancelBubble = true; 
    event.returnValue = false; 
    return false; 

    srcElement,cancelBubble,returnValue,tagName是什么意思?
    tagName是对应:
    <input type="text" name="textfield7" onfocus="setobj(this);this.select()"> 
    吗?
      

  2.   

    回答你第三個問題:
    key==8 是指backspace鍵
    key==116 是指f5
      

  3.   

    1.
    function setobj(input){ 
    obj=input; 
    }函数的传入参数是INPUT对象,将全局变量obj的值给赋为input,那么现在obj就是INPUT控件了,就可以用obj.value来获取文本框的值
      

  4.   

    2.
    function init(){ 
    document.onkeydown=keyDown(); 
    document.onkeyup=keyUp(); 
    }触发文档的按下抬起事件时调用自定义函数,省略了()
      

  5.   

    3.
    key==116和key==8的是代表键盘的什么键?
    键盘代码可以在MSDN中查到.
      

  6.   

    4.
    srcElement,cancelBubble,returnValue,tagName是什么意思?看event对象的属性
    event--------------------------------------------------------------------------------DescriptionRepresents the state of an event, such as the element in which the event occurred, the state of the keyboard keys, the location of the mouse, and the state of the mouse buttons. The event object is available only during an event. That is, you can use it in event handlers but not in other code. You retrieve the event object by applying the event keyword to the window object. Although all event properties are available to all event objects, some properties might not have meaningful values during some events. For example, the fromElement and toElement properties are meaningful only when processing the onmouseover and onmouseout events. ExamplesThe following example checks whether a mouse click occurred within a link and prevents the link from being carried out if the SHIFT key is down. <HTML>
    <HEAD><TITLE>Cancels Links</TITLE>
    <SCRIPT LANGUAGE="JScript">
    function cancelLink() {
        if (window.event.srcElement.tagName == "A" && window.event.shiftKey) 
            window.event.returnValue = false;
    }
    </SCRIPT>
    <BODY onclick="cancelLink()">The following example displays the current mouse position in the browser's status window. <BODY onmousemove="window.status = 'X=' + window.event.x + ' Y=' + window.event.y">Note that in VBScript you cannot use the event keyword without applying it to the window keyword or an expression that evaluates to a window. PropertiesaltKey, button, cancelBubble, clientX, clientY, ctrlKey, fromElement, keyCode, offsetX, offsetY, reason, returnValue, screenX, screenY, shiftKey, srcElement, srcFilter, toElement, type, x, y Applies Towindow 
      

  7.   

    谢谢了我好像看不出那里有调用了init()方法?
    是自动调用的吗?
    <input type="text" name="textfield7" onfocus="setobj(this);this.select()"> 
    只是调用了setobj(this)方法而以
      

  8.   

    gjd111686(数字金刚) :
    你有javascript的资料吗能发给我吗?谢谢!
    [email protected]
    [email protected]
      

  9.   

    http://www.programfan.com/club/showbbs.asp?id=20875
      

  10.   

    下载吧:http://www.programfan.net/teach/jscript5.chm
      

  11.   

    谢谢了我好像看不出那里有调用了init()方法?
    是自动调用的吗?
    <input type="text" name="textfield7" onfocus="setobj(this);this.select()"> 
    只是调用了setobj(this)方法而以
    这个手册我有,但是找不到event,srcElement,cancelBubble,returnValue,tagName等这些东东的解释
      

  12.   

    啊你要的在IEREF.chm中,你手头有MSDN的话就应该有.
      

  13.   

    http://203.64.35.73/dn60acht2/msdn/IEREF.CHMMSDN的全部
    http://203.64.35.73/dn60acht2/msdn/
      

  14.   

    谢谢了我好像看不出那里有调用了init()方法?
    是自动调用的吗?
    --------------
    不是的,在页加载完成的时候就调用了onload="init()"
    <body bgcolor="#FFFFFF" text="#000000" onload="init()">
      

  15.   

    event,srcElement,cancelBubble,returnValue,tagName
    这些可以在HTML
    http://vip.5d.cn/friday/upload/dhtml html&css.chm 里面找到.