this is my javascript
<head runat="server">
<script type="text/javascript" language="javascript">
function createQuestionPanel() {
var element = document.createElement("Input");
element.setAttribute("type", "button");
element.setAttribute("value", "button");
element.setAttribute("name", "button");
var div = '<div>top div</div>';
div[0].appendChild(element);
}
function formvalidate() {
}
</script>
</head>
<body onload="createQuestionPanel()">
</body>
</html>
it is throwing error "AppendChild is not a function" . I tried to search for solution .. it was suggested that on the place of
div.appendChild(element);
this should be posted
div[0].appendChild(element);
it didnt change the error . Please suggest
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…