js 怎么隐藏整个select?

JavaScript021

js 怎么隐藏整个select?,第1张

<script type="text/javascript">

function doProcess() {

var o = document.getElementById("one"), ddl = document.getElementById("termType")

//兼容FF

var className = typeof (o.getAttribute("className")) == "string" ? "className" : "class"

if (ddl.options[ddl.selectedIndex].value == "1") {

o.setAttribute(className, "hidden")

} else {

o.setAttribute(className, "show")

}

}

</script>

<style type="text/css">

.show

{

display:block

}

.hidden

{

display:none

}

</style>

<div><select name="termType" size="1" id="termType" style="width:150px" onchange="doProcess()">

<option value="1">我要隐藏</option>

<option value="2">我要显示</option>

</select>

<div>

$(document).on('click',function(event){

判断event.target 来源dom对象,

如果是你指定的input或者select ,return false

$('xxx').hide()

})