您好我无法将按钮追加到动态创建的table.I知道这是一个简单的问题,但我试着查看引入的逗号和连接运算符,但无法得到结果。无法将按钮追加到jquery
$("#myTable").append("<tr id="+staticI+"><td>"+localStorage.getItem(staticI+" a")+"</td> <td>"+localStorage.getItem(staticI+" b")+"</td><td>"+localStorage.getItem(staticI+" c")+"</td><td><button type="button">D</button>"+"</td></tr>");
铬会抛出各种错误,如未定义按钮或意外标识符。请帮助。谢谢。
您正在添加'type =“按钮”'。尝试'type ='button'',因为你正在用'''开始字符串,所以另一个'''会结束它。 –
谢谢Rahul.It工作。 –