Jquery newbie here.
In a wrapped element set, is there a way to check if the element supports this property?
I basically have this pseudocode.
$(function () {
$("form").each(function(){
if("this element supports disabled"){
$(this).attr("disabled", "disabled");
}
});
});
I was thinking that if the element does not support this property then it should be skipped.
In my example above, I was checking if the element supports the disabled attribute.
Thanks
It really isn’t possible to tell because you can set an attribute on an element even if it doesn’t support it. As far as I know, only form elements support the
disabledproperty, so you can just check if the element is of typeinput,select,textareaorbutton. (there may be a few more that I missed)