Element accessible with ID

前端 未结 2 1438
耶瑟儿~
耶瑟儿~ 2020-12-04 02:04

I saw a strange behavior. I created a Input.

and tried to access it directly fr

2条回答
  •  爱一瞬间的悲伤
    2020-12-04 02:30

    Back in the days of 4.0 browsers, Microsoft decided that it would be convenient to create, for every element with an id, a global variable with the same name as the id containing a reference to that element.

    Support for this has appeared in some other browsers (in some rendering modes). This support is not universal so the feature should be avoided.

提交回复
热议问题