I get a boolean
value of the database, in which I want to set a checkbox
dynamically. The value received is 0
or 1
. I tried to do it this way below:
var status = 1; //valor recebido
$("#status").prop('checked', status);
However according to with the documentation of the method prop , you should receive as a parameter boolean
or a function, and not a numeral.
How do I convert a numeric value to boolean
?