JSP页面循环
<div class="daikuan-main">
<div class="daikuan-list"><c:if test="${flist!= null}">
<c:forEach items="${flist}" var="mp">
<div class="daikuan-list1">
<p style="border-right:1px dashed #dcdcdc;">
<a style="background:#FFFFFF; " href="../loan/dkcp.action?company_id=${mp.company_id }";>
<img style="padding-left:30px;" name="img" src="../images/gs1.jpg"/>
</a>
<br/><br/>${mp.com_name}<br/>
</p>
<p style="border-right:1px dashed #dcdcdc;" οnclick="shenqing(this)">贷款类型<br/>${mp.loan_type}<br/>${mp.make_loan_time}放贷
<input style="display: none;" name="loan_id" value="${mp.loan_id}"/>
</p>
<p style="border-right:1px dashed #dcdcdc;" οnclick="feiyong()">费用详情<br/>月费率:${mp.month_interest}%<br/>一次性费用:${mp.nonrecurring_expense}%
</p>
<p>无职业要求<br/><a id="shenqing" class="shenqing" href="../loan/sbzdk.action?loan_id=${mp.loan_id}&name=${mp.loan.name }" style="margin-left:40px; ">申请</a></p>
</div>
</c:forEach>
</c:if>
<!-- 当没有贷款时 空来使广告图片不移位 -->
<div style="width:8px;height: 1px;"></div>
</div>
js中
function feiyong(s){
var loan_id=$(s).find("[name='loan_id']").val();
window.location.href='<c:url value="/loan/look-loan.action"/>'+'?loan_id='+loan_id;
}
当不使用(s).find()时onclick绑定一个loan_id