如何在js中添加节点时设置其属性

2025-06-21 17:53:23
推荐回答(1个)
回答1:

var btn=document.createElement("BUTTON");
  btn.setAttribute('value', 'text');  
  
 好像是这样