$('input.editor-active', row).prop( 'checked' with variables
$('input.editor-active', row).prop( 'checked' with variables
Hildeb67
Posts: 67Questions: 19Answers: 1
I have this Code rows
var kalenderwoche = 'kw08';
$('input.editor-active', row).prop( 'checked', data[kalenderwoche].Mo_mitbus == 1 );
This work perfect but with the variable "mitbusfahrt" does not work
var kalenderwoche = 'kw08';
var mitbusfahrt = '.Mo_mitbus';
$('input.editor-active', row).prop( 'checked', data[kalenderwoche]mitbusfahrt == 1 );
can someone help me here?
Thanks and regards Christian
This question has an accepted answers - jump to answer
Answers
You will need to remove the
.
in'.Mo_mitbus'
and place the variable in brackets, like this:Kevin
Thanks a lot works perfectly