I am a beginner at javascript.
I'd like to print the table that I just wrote on the head.
I couldn't.Where did you get it wrong?
Could you tell me?
Thank you for your cooperation.
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title> </title>
<script>
function print_table(){
var goods=["chair", "desk", "bookstand";
var price = [4000,12000,800];
for(vari=0;i<3;i++){
document.write("<tr>");
document.write("<td>"+good[i]+"</td>");
document.write("<td>"+price[i]+"yen</td>");
document.write("</tr>");
}
}
</script>
</head>
<body>
<table border="1">
<tr><th>Product Name</th><Price>/th><>
<script>
print_table();
</script>
</table>
</body>
It's solved!It's not good, but goods is more correct.
© 2025 OneMinuteCode. All rights reserved.