<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>Document</title> <script src="js/jquery.js"></script> </head> <body> <select name="cate_id" id="cate_id" class="cate_a" style="padding: 5px 10px;float: left;margin:0px 5px"> <option value="0" selected="selected">所有分类</option> <option value="1">奔驰</option> <option value="2">宝马</option> <option value="3">奥迪</option> <option value="4">保时捷</option> <option value="5">大众</option> <option value="6">本田</option> <option value="7">丰田</option> </select> </body> <script> $(‘.cate_a‘).on(‘change‘,function(){ // 获取select中选中option的文本值 var text =$(this).find("option:selected").text() // 获取select中选中option的value值 var opval=this.options[this.selectedIndex].value; console.log(opval+‘-----‘+text) }) </script> </html>