在<script>标签里面怎么设置超链接属性?
我的代码如下请javascript高手指点,在这个里面怎么设置link,vlink,hover等属性值.
<table width="630" border="0" cellspacing="0" cellpadding="0" id="table1" bgcolor="#CEF9D5" height="407" bordercolor="#2ECB5C">
</table>
<script language="javascript">
var value = [['baidu','baidu'], ['baidu','baidu']];
var link = [[ 'http://www.baidu.com', 'http://www.baidu.com'],
['http://www.baidu.com', 'http://www.']];
setAttribute("width","200");
var tbody = document.createElement('tbody');
for (var i = 0; i < value.length; i++) {
var tr = tbody.appendChild(document.createElement('tr'));
for (var j = 0; j < value[i].length; j++) {
var td = tr.appendChild(document.createElement('td'));
var a = td.appendChild(document.createElement('<a href="#">'));
a.href = link[i][j];
a.innerText = value[i][j];
} }
document.getElementById('table1').appendChild(tbody);
</script>