jquery - Make a checkbox and checkbox text disable -


I have a checkbox that I need to disable with the disabled text of the checkbox, but I failed to do so. I have the following code:

  $ ('Input: checkbox [type = "checkbox"]'). Each (function () {$ (this) .attr ("disabled", true) .attr ("readable", true);});  

The above code is not disabling my checkbox, but I am able to check and uncheck the checkboxes.
The only thing I wanted to do is disable the checkbox and if the value of the check box I am loading in the backend is checked, then its position should not be affected. I also want to disable the checkbox text

Please note I have dynamically prepared the checkbox and here is the code for it:

  if (cellvalue == "True ") {Html =" & lt; input type = 'checkbox' class = 'checkbox user' id = 'checkbox "+ row +"' check / & gt; " } Other {html = "& lt; input type = 'checkbox' square = 'check box user' id = 'checkbox" + row + "' /> } Return HTML;  

Please try the following

  $ (' Input: checkbox [type = "checkbox"]). Each (function () {$ (this) .prop ("disabled", true);});  

Comments

Popular posts from this blog

ios - How do I use CFArrayRef in Swift? -

eclipse plugin - Run java code error: Workspace is closed -

c - Error on building source code in VC 6 -