切頁面時有時用連結A來替代按鈕,這樣做有幾個好處
滑鼠放上時預設有手狀效果(不用加cursor:pointer)
可以添加低版本IE都支援的偽類
若點擊時頁面要整體刷新,即跳轉,這時IE6則不盡人意,如下
複製程式碼
程式碼如下:
Sina
Sohu <script> <BR>function jumpSina() { <BR>location.href = 'http://www.sina.com.cn' <BR>} <BR>function jumpSohu() { </script>
location.href = 'http://www.sohu.com'
}
複製程式碼
程式碼如下:
Sina
Sohu a>
<script> <BR>function jumpSina() { <BR>location.href = 'http://www.sina.com.cn' <BR>} <BR>function jumpSohu( ) { </script>
location.href = 'http://www.sohu.com'
}
複製程式碼
程式碼如下:
Sina
<script> <BR>function jumpSina() { <BR>window.open( 'http:/ /www.sina.com.cn') </script>
}