Click here to Skip to main content
15,901,122 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I'm using .prop("disabled") method to get the number of disabled div. it behaves correct when run on IE(Internet Explorer) but doesn't show up the same behavior for chrome browser.
below is the code i used:
$('#UserEditShopList li .accountText').each(function () {
if ($(this).prop("disabled")) {
countEnabled++
}
});
Posted
Updated 25-Jul-16 9:48am
v2
Comments
Karthik_Mahalingam 25-Jul-16 4:53am    
jquery-ui.min.js, this is for UI,
you have to add jquery core js.
Member 8660975 25-Jul-16 5:31am    
Hi Karthik, thank you. I'll try adding this. but wanted to know why it behaves differently for browsers
Karthik_Mahalingam 25-Jul-16 5:44am    
which version of jquery are you using?
Member 8660975 25-Jul-16 8:47am    
jquery-1.6.4
Karthik_Mahalingam 25-Jul-16 13:01pm    
i checked, its working fine..

1 solution

If you are using jQuery < 1.6 do this:
JavaScript
jQuery .attr("disabled", 'disabled');


If you are using jQuery 1.6+:
JavaScript
jQuery .prop("disabled", true);


See this question: .prop() vs .attr() for references why.
Or you can try this:
JavaScript
.attr("disabled", 'disabled');
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900