<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>Title</title> <script type="text/javascript" src="https://www.imooc.com/static/lib/jquery/1.9.1/jquery.js"></script> </head> <body> <form action=""> <input type="text" value="请输入内容..." id="input"> <ul> <li class="prev" ><a href="" id="prev">上一页</a></li> <li><a href="#"></a>1</li> <li><a href="#"></a>2</li> <li><a href="#"></a>3</li> <li class="next" ><a href="#" id="next">下一页</a></li> </ul> </form> <script> $(document).ready(function () { console.debug(1); var prev = document.getElementById("prev"); var next = document.getElementById("next"); var inputText = document.getElementById("input"); // // prev.click(function () { }) }); </script> </body> </html>
因为这里prev.click(
function
() {
}),删了就可以