我有我的外部JavaScript打印交叉
function cross()
{
var output2 = document.getElementById('output2');
var a = "*"
, b = " "
, i = 0
, j = 0
, k = 0
;
for(i = 1, k = input; i <= input; i++, k--)
{
for(j = 1; j <= input; j++)
{
if (j == i || j == k)
{
output2.value += a;
}
else
{
output2.value += b;
}
output2.value += '\n';
}
}
}
此代码,这个网站按钮,我的第一页+文本区我的第二页上,使文本区将在第二页显示(halaman.html
)我点击第一页上的按钮后。
<!-- code page 1-->
<a href="halaman.html"><input type="button" value="Muncul page baru" onclick="cross();"></a><br />
<!-- code page 2-->
<textarea id="output2" rows="20" cols="90"></textarea>
十字架不显示在第二页上。什么是错的,我该怎么办?