标签:
<form id="sf"> <input type="hidden" id="price" name="price"> <input type="hidden" name="name"> </form>
<li class="price"> <a rel="all" class="${requestScope.price == ‘all‘ ? ‘select‘ : ‘‘}" href="">不限</a> <a rel="200" href="">200</a> <a rel="400" href="">400</a> </li>
//js
$(".price a").click(function(){ var rel = $(this).attr("rel"); $("#price").val(rel); $("#sf").submit(); });
页面上显示的供点击的都是一些li
然后没点击一项在上面的隐藏域中添加value属性
然后提交这个表单
搜索完之后的选中效果是
<a rel="all" class="${requestScope.price == ‘all‘ ? ‘select‘ : ‘‘}" href="">不限</a>
标签:
原文地址:http://www.cnblogs.com/itliucheng/p/4465943.html