a标签href="javascript:;"
//点击a链接,执行一段js代码
<!DOCTYPE html> <html> <head> <title></title> </head> <body> <a id="jsPswEdit" class="set-item" href="javascript:;">修改密码</a> </body> </html> <script type="text/javascript"> document.getElementById('jsPswEdit').addEventListener('click', function(e) { e.preventDefault(); // 当<a>触发click时,处理业务 alert("111"); }, false); </script>