I'm new to HTML and Javascript, what i'm trying to do is from an HTML
file i want to extract the things that set there and display it to another HTML
file through Javascript
(我是HTML和Java脚本的新手,我想做的是从an HTML
文件中提取要设置的内容,并通过Javascript
将其显示到another HTML
文件中。)
Here's what i done so far to test it:(这是我到目前为止所做的测试:)
(testing.html)((testing.html))
<html>
<head>
<script language="javascript" type="text/javascript" src="asd.js"></script>
</head>
<body>
<form name="form1" action="next.html" method="get">
name:<input type ="text" id="name" name="n">
<input type="submit" value="next" >
<button type="button" id="print" onClick="testJS()"> Print </button>
</form>
</body>
</html>
(next.html)((next.html))
<head>
<script language="javascript" type="text/javascript" src="asd.js"></script>
</head>
<body>
<form name="form1" action="next.html" method="get">
<table>
<tr>
<td id="here">test</td>
</tr>
</table>
</form>
</body>
</html>
(asd.js)((asd.js))
function testJS()
{
var b = document.getElementById('name').value
document.getElementById('here').innerHTML = b;
}
test.html
-> ads.js
(will extract value from the test.html and set to next.html) -> next.html
(test.html
> ads.js
(将从test.html中提取值并设置为next.html)-> next.html
)
ask by newbie translate from so
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…