Copy Code code as follows:
<! DOCTYPE html>
<meta http-equiv= "Content-type" content= "text/html; Charset=utf-8 "/>
<title></title>
<script src= "Http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js" type= "Text/javascript" ></ Script>
<script type= "Text/javascript" >
The following plug-ins are recommended in the JS file to facilitate the call
--------------Plugin begin------------------
(function ($) {
masks, suitable for individual elements.
$.fn.mask = function () {
var divhtml = ' <div class= ' Divmask "style=" Position:absolute; width:100%; height:100%; left:0px; top:0px; Background: #fff; opacity:0; Filter:alpha (opacity=0) "> </div>";
$ (this). Wrap (' <span style= "position:relative" ></span> ");
$ (this). Parent (). append (divhtml);
$ (this). Data ("Mask", "true");
}
Remove Mask
$.fn.unmask = function () {
$ (this). Parent (). Find (". Divmask"). Remove ();
$ (this). Unwrap ();
$ (this). Data ("Mask", "false");
}
}) (JQuery);
--------------Plug-in End------------------
Did not do disabled processing, just add a shield layer above, make it cannot point to just.
This makes it more convenient for other places to be treated without further treatment.
function changeA2 (obj) {
var t = {' key ': ' B ', ' Value ': ' 2 '};//mapping corresponding relationship
if (Obj.value = = T.key) {
$ ("#A2"). Val (T.value);
$ ("#A2"). Mask ();
} else {
$ ("#A2"). Val ("");
$ ("#A2"). unmask ();
}
}
</script>
<body>
<select name= "A1" id= "A1" onchange= "changeA2" (This) >
<option value= "" >--Please choose--</option>
<option value= "a" >a</option>
<option value= "B" >b</option>
<option value= "C" >c</option>
<option value= "D" >d</option>
</select>
<select name= "A2" id= "A2" >
<option value= "" >--Please choose--</option>
<option value= "1" >1</option>
<option value= "2" >2</option>
<option value= "3" >3</option>
<option value= "4" >4</option>
</select>
</body>