javascript - don't chang checkbox value -


I want to define the new role after adding the checkboxes in javascript (change the checkbox value when clicking on it). But this is my code:

  $ (document) .change ('add', function () {$ (". Activateuploadedpic") click (function () {if ( $ (This) .val () == 'true') {$ (this) .attr ('value', 'false');} and {$ (this) .attr ('value', 'true'); }}};});  

You can change it:

  $ (".activateuploadedpic") (function () {$ (this) .attr ("value", $ (this) .prop ("checked"));};  
  & lt; Script src = "https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js" & gt; & Lt; / Script & gt; & Lt; Input type = "checkbox" value = "false" class = "activateuploadedpic" />  


Comments

Popular posts from this blog

winforms - C# Form - Property Change -

java - Messages from .properties file do not display UTF-8 characters -

javascript - amcharts makechart not working -