How can I check if a checkbox is checked in JavaScript while building a mobile web app?

On jQuery Mobile projects, this blends perfectly with form stylings and auto-inits, and it avoids native quirks across devices.

function validate() {
  if ($('#remember').is(':checked')) {
    alert("Checked!");
  } else {
    alert("Not checked!");
  }
}