0
아래의 마지막 함수 displayLetter (a, b, c, d, e, f, g)를 함께 쓰거나 배열 요소로 innerHTML의 테이블에 쓰는 데 문제가 있습니다. variableTest()에있는 변수. 나는 .length를 사용하고 얼마나 많은 셀을 필요로 하는지를 알아야합니다. W3C는 지금까지만 나를 얻는다. 도와 주셔서 감사합니다!innerHTML을 사용하여 HTML 테이블에 셀 데이터 쓰기
<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>
MY 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
}