<form action="" type="get" id="form">
<input type="button" name="submit" id="subBtn" value="submit">
</form>

点击按钮,触发表单提交:

document.getElementById("subBtn").onclick=function(){
document.getElementById("form").submit();
}

会报错(chrome下):

Uncaught TypeError: Property 'submit' of object #<HTMLFormElement> is not a function

原因是name="submit"这句,换成别的name=sb1,sb2,sb2。。。

另外,经测,将id="submit",也会这样

同理,用于reset

一句话!!:

在表单里,别用name="submit|reset" 或  id="submit|reset"

ps:今天遇到了此错误,纠结了半天,记录一下,以警醒。

Property 'submit' of object #<HTMLFormElement> is not a function的更多相关文章

  1. 2.mongoDB add user in v3.0 问题的解决(Property 'addUser' of object admin is not a func)

    问题:创建mongodb帐户时,出错 > db.addUser('jyu', 'aerohive')  2015-08-05T20:03:02.767+0800 E QUERY    TypeE ...

  2. Vue的报错:Uncaught TypeError: Cannot assign to read only property 'exports' of object '#<Object>'

    Vue的报错:Uncaught TypeError: Cannot assign to read only property 'exports' of object '#<Object>' ...

  3. Vue报错:Uncaught TypeError: Cannot assign to read only property’exports‘ of object’#<Object>‘的解决方法

    发现问题 运行一下以前的一个Vue+webpack的 vue仿新闻网站  小项目,报错 由于自己vue学习不深入,老是这个报错,找了好久(确切的说是整整一下午^...^)才找到原因 -v- Uncau ...

  4. [one day one question] webpack 打包报错 Cannot assign to read only property 'exports' of object '#<Object>'

    问题描述: webpack 打包报错 Cannot assign to read only property 'exports' of object '#<Object>',这怎么破? 解 ...

  5. Vue 使用自定义组件时报错:Uncaught TypeError: Cannot assign to read only property 'exports' of object '#<Object>'

    自己试做了一下vue的插件 参考element-ui: 写了一个组件 import message from './packages/message/index.js'; const install ...

  6. Uncaught TypeError: Cannot assign to read only property 'exports' of object '#<Object>'

    Uncaught TypeError: Cannot assign to read only property 'exports' of object '#<Object>' 点开错误的文 ...

  7. vue运行报错error:Cannot assign to read only property 'exports' of object '#<Object>'

    用weex做项目的时候,npm start 之后一直报错error:Cannot assign to read only property 'exports' of object '#<Obje ...

  8. 在Vue中使用i18n 国际化遇到 Uncaught TypeError: Cannot assign to read only property 'exports' of object '#<Object>'

    最近用Vue在搭建前端框架,在引用i18n时,运行的时候报错:Uncaught TypeError: Cannot assign to read only property 'exports' of ...

  9. Cannot assign to read only property 'exports' of object '#<Object>' ,文件名大小写问题!!!

    有些坑不知道怎么就掉进去,可能一辈子都爬不起来!!! 一.错误描述 昨天还好好的,今天早上来从git获取了一下别人提交的代码就出错了!而提交代码的人 运行一点错误都没有!!! cya@KQ-101 M ...

随机推荐

  1. mysql 数据操作 多表查询 多表连接查询 笛卡尔积

    1 交叉连接:不适用任何匹配条件.生成笛卡尔积 所有员工都和四个部门 做了对应关系 mysql> select * from employee,department; +----+------- ...

  2. LockSupport HotSpot里park/unpark的实现

    每个java线程都有一个Parker实例,Parker类是这样定义的: class Parker : public os::PlatformParker { private: volatile int ...

  3. ArcEngine几何变换中的策略模式

    使用策略模式可以减少分支语句,switch...Case,同时便于策略的扩展. 1. ITransform2D接口的Transform方法: [C#]public void Transform ( e ...

  4. PAT 1135 Is It A Red-Black Tree[难]

    1135 Is It A Red-Black Tree (30 分) There is a kind of balanced binary search tree named red-black tr ...

  5. 【pycharm】pycharm中设置virtualenv的虚拟环境为开发环境

    pycharm中设置virtualenv的虚拟环境 因为在pycharm写代码比较方便 但是有时候virtualenv安装的环境在pycharm中会有红色波浪线报语法错误.作为一个强迫症,这怎么能忍, ...

  6. linux C 程序内存布局

    参考: 1. http://www.cnblogs.com/clover-toeic/p/3754433.html 2. http://www.cnblogs.com/jacksu-tencent/p ...

  7. http之url和uri

    HTTP使用统一资源标识符(Uniform Resource Identifiers, URI)来传输数据和建立连接.URL是一种特殊类型的URI,包含了用于查找某个资源的足够的信息 URL,全称是U ...

  8. CCF地铁修建

    问题描述 A市有n个交通枢纽,其中1号和n号非常重要,为了加强运输能力,A市决定在1号到n号枢纽间修建一条地铁. 地铁由很多段隧道组成,每段隧道连接两个交通枢纽.经过勘探,有m段隧道作为候选,两个交通 ...

  9. org.apache.ibatis.exceptions.TooManyResultsException的异常排查过程

    在查阅测试环境业务日志中的ERROR级别的日志时,发现了有一个Mybatis相关的异常错误org.apache.ibatis.exceptions.TooManyResultsException: E ...

  10. 2016-2017 ACM-ICPC Pacific Northwest Regional Contest (Div. 1) Solution

    A:Alphabet Solved. 签. #include<bits/stdc++.h> using namespace std; ]; ]; int main(){ scanf(); ...