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

前端 未结 7 610
时光取名叫无心
时光取名叫无心 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:03

    IE DOM does not allow me to change name attribute on runtime. However, using jQuery to update the name attribute works on IE. I tested on IE9. For examples,

    
    $("#ID0E2B").attr("name", newName);
    

提交回复
热议问题