真正实现 select 下拉 只读 readonly

 

<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.0/jquery.min.js"></script>


<SCRIPT LANGUAGE="JavaScript">

 $(document).ready(function(){ 
	var index=$("#countries").attr('selectedIndex')
	$("#countries").change(function() {
		this.selectedIndex=index;
	 });
});

</SCRIPT>


<select id="countries" > 
	<option value="1">Country1</option> 
	<option value="2">Country2</option> 
	<option value="3">Country3</option> 
	<option value="4">Country4</option> 
	<option value="5">Country5</option> 
	<option value="6">Country6</option> 
	<option value="7">Country7</option> 
	<option value="8">Country8</option> 
	<option value="9">Country9</option>
</select>

 

 原理:

<select  onchange="this.selectedIndex=1">  
<option>1 </option>  
<option  selected>2 </option>  
<option>3 </option>  
</select>

你可能感兴趣的:(readOnly)