以下の最終関数displayLetter(a、b、c、d、e、f、g)をまとめて、変数Test()の配列要素と変数を使用してinnerHTMLのテーブルに書き込むのに問題があります。.length を使用して、必要なセルの数を決定する必要があることはわかっています。W3C はこれまでのところしか理解できません。助けてくれてありがとう!
<html>
<head>
<title>
</title>
<script>
</script>
</head>
<body>
<h1>TEST THIS SCRIPT</h1>
<table border="1">
<tr>
<th>A</th>
<th>B</th>
<th>C</th>
<th>D</th>
<th>E</th>
<th>F</th>
<th>G</th>
</tr>
<a href="add data" id="reload">Add Employee</a>
</body>
<html>
私のJS:
function addData()
{
var testarray = new Array();
testarray[0] = window.prompt("Enter a letter", "z");
variableTest(x, y);
displaySalary(a, b, c, d, e, f, g);
}
function variableTest(x, y)
{
a=1;
b=2;
c=3;
d=4;
e=5;
}
displayLetter(a, b, c, d, e, f, g)
{
// Code to write the variables to the table
}