close

http://blog.roodo.com/brysonbo/archives/9559597.html

[程式] html button 製作回上一頁按鈕、超連結按鈕

利用javascript的幫助,我們可以用html的button來輕鬆製作出,
回上一頁的按鈕、超連結按鈕



主要的語法如下

回上一頁的按鈕

<input name="Submit" type="button" id="Submit" onClick="javascript:history.back(1)" value="回一上頁" />

超連結按鈕

<input type="button" value="首頁" onclick="self.location.href='main.html'"/>



以下我做了兩支html的網頁,作為範例...
 

main.html
=========start=============

<html>
<body>
<h1>javascript 回上一頁按鈕</h1>
This is main page!!
<br>
<a href='next.html'>到下一頁</a>
</body>
</html>

========= end =============




next.html
=========start=============

<html>
<body>
<h1>This is next page!!</h1><br><br><hr>


<h3>回上一頁按鈕</h3>
<input name="Submit" type="button" id="Submit" onClick="javascript:history.back(1)" value="回一上頁" />

<hr><br><br>

<h3>超連結按鈕</h3>
<input type="button" value="首頁" onclick="self.location.href='main.html'"/>

</body>
</html>

========= end =============
arrow
arrow
    全站熱搜

    pcwiki 發表在 痞客邦 留言(0) 人氣()