<img onclick="这里直接写文本框双击时运行的函数">

解决方案 »

  1.   

    <img src="http://www.dearbook.com.cn/book/images1/smallTS_750831827101top.jpg" onclick="text1.ondblclick()">
    <input id="text1" type="text" ondblclick="alert('Double clicked.')">
      

  2.   

    给你一个样版
    <HTML>
    <HEAD>
    <SCRIPT>
    function fnFireEvents()
    {
    oDiv.innerText = "The cursor has moved over me!";
    oButton.fireEvent("onclick");
    }
    </SCRIPT>
    </HEAD>
    <BODY>
    <h1>Using the fireEvent method</h1>
    By moving the cursor over the DIV below, the button is clicked.
    <P>
    <DIV ID="oDiv" onmouseover="fnFireEvents();">
    Mouse over this!
    </DIV>
    <p>
    <BUTTON ID="oButton" ONCLICK="this.innerText='I have been clicked!'" >
    Button</BUTTON>
    </BODY>
    </HTML>