
1个回答
展开全部
<!DOCTYPE HTML>
<html lang="en-US">
<head>
<meta charset="UTF-8">
<title>main.html</title>
<style type="text/css">
table {
width: 100%;
border: 1px solid black;
border-collapse: collapse;
}
td {
border: 1px solid black;
}
</style>
<script type="text/javascript">
onload = function ()
{
var table = document.getElementById ("table");
var tr = table.insertRow (0);
tr.onclick = function ()
{
alert ('spider man');
}
var td = tr.insertCell(0);
var txt = document.createTextNode('ddd');
td.appendChild(txt);
}
</script>
</head>
<body>
<table id="table">
</table>
</body>
</html>
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询