zoukankan      html  css  js  c++  java
  • js中动态更改事件(如onFocus后改为onclick)

    <%@ Page Language="C#" AutoEventWireup="true"  CodeFile="Default.aspx.cs" Inherits="_Default" %>

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

    <html xmlns="http://www.w3.org/1999/xhtml" >
    <head runat="server">
        <title>Untitled Page</title>
        <script language=javascript>
    function _001(obj,xx1,xx2,xx3)
    {
            alert("focusValue="+obj.id+"|"+xx1+"|"+xx2+"|"+xx3)
            obj.onfocus=null
            obj.onclick=function()
            {
                    _002(obj,xx1,xx2,xx3)
            }
    }
    function _002(obj,yy1,yy2,yy3)
    {
            alert("clickValue="+obj.id+"|"+yy1+"|"+yy2+"|"+yy3)
    }
    </script>


    </head>
    <body>
        <form id="form1" runat="server">
        <div>
       <input id="txt" type="text" name="t_xt" onfocus="_001(this,1,2,3);">
        </div>
        </form>
    </body>
    </html>

  • 相关阅读:
    每周总结8.18
    每周总结7.28
    每周总结8.25
    每周总结7.21
    每周总结8.11
    每周总结8.4
    大道至简 读后感
    递归进行回文的判断
    课后作业1
    GoodBlogs Websites
  • 原文地址:https://www.cnblogs.com/xzp/p/1239856.html
Copyright © 2011-2022 走看看