Using jqm SetValue with CheckBox

If I try to run this code in a browser

If strChecked = "Checked" Then chkRememberMe.setValue(1, True)

I get an error [Uncaught TypeError: chkRememberMe.setValue is not a function].

Have I misinterpreted [setValue(n, val)] incorrectly?

My checkbox is jqm with id chkRememberMe and is a single checkbox.

Yes, this should work fine.

Is there any chance you are doing this right at startup? If so, the control may not be full formed yet.

Thank you - that appears to have been the problem. Moved it to Sub Main() and all is good.