Can I use JavaScript to set the 'name' attribute?

前端 未结 7 581
时光取名叫无心
时光取名叫无心 2020-12-11 16:56

According to SitePoint (and my own experiments), the IE implementation of \"setAttribute()\" is buggy and unreliable.

Also according to SitePoint, the name

7条回答
  •  时光说笑
    2020-12-11 17:10

    Have you tried simply assigning a new name to the elements name property? I'm not sure how cross-browser that is but it shold work with anything supporting DOM level 1.

    I'm not sure why you would use setAttribute to perform this?

提交回复
热议问题