-
大神们!!怎么判断input里面是下拉是弹出层,里面的下拉和弹出层都是用div做的。这个if判读语句该怎么写。。。。跪谢!!!!
2016-06-01 10:41<form> <input type="text" show="select" > 打开下拉框 <input type="text" show="modal" > 打开弹出层 </form> <script> $(document).ready(function(){ $("input[type='text']").on('click', function(){ var type = $(this).attr("show"); if(type == "select"){ alert("点击下拉框"); }else if(type == "modal"){ alert("点击弹出层"); } }); }); </script>