以前用按鈕(Button)都是用<form>裡面包著Button,然後再把Button要連結到的網頁輸入在<form>標籤裡,如下:

<form name="form" method="post" action="index.html">

      <input type="submit" value="送出" />

</form>

但我因為要美觀的關係,不想用超連結,因為都是藍色的字加上底線,於是就找到一個方法,也就是用JavaScript的方法,這樣程式碼也會簡潔一點,如下:

<input type="button" value="送出" onclick="self.location.href='index.html'"/>

 

大家可參考看看,若有更棒的方法,也可以一起來交流一下,因為我網頁美工不太會,又想學網頁美工,但總是不知如何下手>"

arrow
arrow
    全站熱搜

    dreamtails 發表在 痞客邦 留言(2) 人氣()