如何在javascript中设置td中某个值的id [英] how to set an id with some value in of td in javascript
本文介绍了如何在javascript中设置td中某个值的id的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我在javascript中创建td我想要的是这个< td id ='abc'>
如何在javascript中设置td id我使用 setAtteribute()
无法正常工作
i m creating td in javascript what i want is this "<td id='abc'>"
how can i set the td id in javascript i use setAtteribute()
not working
我的代码看起来像这样
var cell4 = row.insertCell(3);
cell4.innerHTML = "Song";
var cell5 = row.insertCell(4);
cell5.setAttribute('id','example1');
我想设置td的id值示例
plz help
i want to set id of the td with value example plz help
推荐答案
cell5.id ='example1'; // javascript
cell5.id = 'example1'; // javascript
我想我们在这里谈论IE?我不知道id,但是..
I suppose we're talking about IE here? I don't know about "id", but..
http://webbugtrack.blogspot.com/2007/08/bug-242-setattribute-doesnt-always-work.html
这篇关于如何在javascript中设置td中某个值的id的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文