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
Post a Comment