我知道这可能是一件简单的事情,但我无法弄明白.我试图将一些来自JavaScript函数onload事件的文本插入到td中.
<html>
<head>
<script type="text/javascript">
function insertText ()
{
//function to insert any text on the td with id "td1"
}
</script>
</head>
<body onload="javascript:insertText()">
<table>
<tr>
<td id="td1">
</td>
</tr>
</table>
</body>
</html>
Run Code Online (Sandbox Code Playgroud)
有帮助吗?