How do I change the ID of a HTML element with JavaScript?

前端 未结 3 1447
無奈伤痛
無奈伤痛 2020-11-28 08:15

I am modifying the ID of an HTML div element client side with JavaScript. The following code works OK in Internet Explorer but not in Firefox/2.0.0.20. It does

3条回答
  •  感情败类
    2020-11-28 08:51

    You can modify the id without having to use getElementById

    Example:

    One

    You can see it here: http://jsbin.com/elikaj/1/

    Tested with Mozilla Firefox 22 and Google Chrome 60.0

提交回复
热议问题