Sometimes using link A to replace buttons when cutting pages, there are several benefits to doing this
When putting the mouse on, there is a hand-like effect by default (no cursor:pointer is required)
You can add pseudo-classes that are supported by lower versions of IE.
If the page needs to be refreshed as a whole when clicking, it will jump, then IE6 will not be satisfied, as follows
The code copy is as follows:
<p><a href="javascript:;" onclick="jumpSina()">Sina</a></p>
<p><a href="javascript:void 0;" onclick="jumpSohu()">Sohu</a></p>
<script>
function jumpSina() {
location.href = 'http://www.sina.com.cn'
}
function jumpSohu() {
location.href = 'http://www.sohu.com'
}
</script>
Clicking on the link in IE6 cannot jump, but other browsers can do it. The solution is to change it to an anchor point.
The code copy is as follows:
<p><a href="###" onclick="jumpSina()">Sina</a></p>
<p><a href="#none" onclick="jumpSohu()">Sohu</a></p>
<script>
function jumpSina() {
location.href = 'http://www.sina.com.cn'
}
function jumpSohu() {
location.href = 'http://www.sohu.com'
}
</script>
If you change the jump method to window.open, there will be no problem in IE6, as follows
The code copy is as follows:
<p><a href="javascript:;" onclick="jumpSina()">Sina</a></p>
<script>
function jumpSina() {
window.open( 'http://www.sina.com.cn')
}
</script>