Skip to content

Instantly share code, notes, and snippets.

@parzibyte
Created September 21, 2022 15:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save parzibyte/269ab72be1f3a0aec4c2ca759a558b71 to your computer and use it in GitHub Desktop.
Save parzibyte/269ab72be1f3a0aec4c2ca759a558b71 to your computer and use it in GitHub Desktop.
didOpen: () => {
const input = Swal.getInput()
const $cambio = Swal.getHtmlContainer().querySelector(
"#cambio");
input.oninput = () => {
$cambio.textContent = "";
const cambio = parseFloat(input.value) - TOTAL_VENTA;
if (cambio > 0) {
$cambio.textContent = `$${cambio.toFixed(2)}`;
}
}
},
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment