You had no question but I give you an answer anyway ;)
"these functions are inside a function", which means that chkBox
is not available when you call it that way. Use .click()
, doc here, or .on()
, or place chkBox
outside the function, if possible.