1.在jsp界面中
跳转 <select onchange="javascript:goPage(this.value);"> <%for(int i=1;i<=pageBean.getPageCount();i++){ %> <option <%=pageBean.getCurrentPage()==i?"selected='selected'":"" %>value="<%=i %>"><%=i %></option> <%} %> </select>
2.js界面
/** * 跳转到pageNum页 * @param pageNum */ function goPage(pageNum){ $("#currentPage").val(pageNum); var form = $("#VelcroForm"); form.submit(); }
3.普通获取下拉框的值的jq方法
<!DOCTYPE html> <html> <head> <meta charset="utf-8" /> <title></title> <script src="js/jquery.js"></script> </head> <body> <!--获取下拉框的值--> <select id="test" name="" onchange="changeValue()"> <option value="1">text1</option> <option value="2">text2</option> </select> </body> <script> function changeValue(){ var select_value=$("#test option:selected"); alert(select_value.val()); } </script> </html>