hanxuming

————————————————————————————————

<script type="text/javascript">
            //动态指定表单的动作属性
            function modifyAction(){
                var f = document.forms[0];        //获取表单DOM
                var newURL = f.newURL.value;    //选择的方法
                f.action = newURL;            //修改提交表单的action地址
                //用提示框展示结果
                alert("表单当前的动作:" + f.action);
            }
        </script>

——————————————————————————————

<body style="text-align:center">
        <!-- 定义表单 -->
        <form method="post">            
            请选择提交方法:
            <input type="text" name="newURL"/>
            <br/>
            <input type="button" value="修改提交Action" onclick="modifyAction()"/>
        </form>
    </body>

————————————————————————————

 

分类:

技术点:

相关文章:

  • 2021-12-13
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-12-31
  • 2022-01-20
  • 2022-12-23
  • 2021-07-02
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-07-12
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案