document.getElementsByTagName("body").item(0).style.cursor="pointer"
}
如果无效则body不够大,换成:
window.onload=function(){document.getElementsByTagName("*").item(0).style.cursor="pointer"
}
当然,最好由CSS解决。
亲,给要经过鼠标变手型的元素加onmouseover事件的处理函数,设置该元素的style.cursor="pointer"就可以了,离开的时候也就是onmouseout的事件处理函数里面加style.cursor=""就可以了用 <a href="...">...</a>做的链接,鼠标默认就是小手型。除非你在 CSS 中有别的定义。
如果页面有引入 css 文件,可以看 css 文件中
a {
...
}
这样的定义,把以上大括号中关于cusor的定义删除即可。
或者像楼上说的写上 cursor:pointer
要在别的地方显示小手图标也是一样的处理,可以用 css,也可以用 style 属性指定:
style="cursor:pointer
"