function center_code() {
+ /* Center the security code inside its red box */
const ct = document.getElementById("codetext");
- /* Now center the security code inside its red box */
/* First, find the center of the red box */
const r1 = document.getElementById("codebg").getBoundingClientRect();
const c1 = r1.left + (r1.width / 2);
/* Set the security code text when the page has loaded */
window.addEventListener("load", set_code);
- /* Center the security code text when the page has loaded;
+ /* Center the security code text when the page has loaded;
in particular, after we set it */
window.addEventListener("load", center_code);