在没有<a>标签的情况下点击<div>,<li>

Emm*_*t B 2 html css jquery

我想要一个<div><li>标签是可点击的(指针应该变为手).没有<a>标签怎么办呢?

因为,当点击div时,我的javascript会加载一个文本文件.

MII*_*IIB 9

你应该添加style="cursor:pointer"手指针和onclick="window.location='somewhere'".

<div style="cursor:pointer" onclick="window.location='index.html'">My Link</div>
Run Code Online (Sandbox Code Playgroud)