html element id as javascript variable

前端 未结 3 1641
感动是毒
感动是毒 2021-02-19 17:10

Consider the following code:





      
3条回答
  •  忘了有多久
    2021-02-19 17:29

    It's an old IE feature, not recommended to use. Several browsers implement it, often as nonenumerable properties of the window object. FF, for example, does it only in quirks mode.

    For further reading see duplicate Is there a spec that the id of elements should be made global variable?...

提交回复
热议问题