<body>
<input type="text" class="in" />
<script>
$(document).ready(function(){
/*
if($(":input").prop("class")==""){
alert("did't has class in")
}else{
alert("have class in")
}
*/
if($(":input").hasClass("in")){
alert("did't has class in")
}else{
alert("have class in")
}
})
</script>
</body>
温馨提示:内容为网友见解,仅供参考