下拉选:
<select onchange="selectTotal(this.value)" style="width: 50px;">
<option value="1">1</option>
<option value="2">2</option>
<option value="3">3</option>
<option value="4">4</option>
<option value="5">5</option>
<option value="6">6</option>
<option value="7">7</option>
<option value="8">8</option>
<option value="9">9</option>
<option value="10">10</option>
</select>
<script type="text/javascript">
function selectTotal(obj){
window.location.href="getAlipayLog.php?pageTotal="+obj;
}
$(document).ready(function (e){
if("${pageTotal }"){ //重点是这个判断
$("option[value='${pageTotal }']").attr("selected",true);
}else{
$("option[value='10']").attr("selected",true);
}
});
</script>