如何禁用下拉元素中的特定项目 [英] How to disable particular item in a drop down element
本文介绍了如何禁用下拉元素中的特定项目的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如何禁用使用jQuery或JavaScript的下拉元素的某些项目? 任何其他的HTML元素,使用
$(/ * option selector * /)。prop('disabled',true);
请参阅 action 。
How do you disable some items of a drop down element using jQuery or JavaScript?
解决方案
The same way you would disable any other HTML element, use
$(/* option selector */).prop('disabled', true);
See it in action.
这篇关于如何禁用下拉元素中的特定项目的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文