Posts

Showing posts with the label html

JavaScript Password Strength Checker

JavaScript Password Strength Checker  document.addEventListener("DOMContentLoaded", function () {     const passwordInput = document.getElementById("password");     const strengthContainer = document.getElementById("oneid-password-strength-container");     passwordInput.addEventListener("input", function () {         const strength = checkPasswordStrength(passwordInput.value);         strengthContainer.textContent = `Strength: ${strength}`;         updateStrengthColor(strengthContainer, strength);     });     function checkPasswordStrength(password) {         let strength = 0;         if (password.length >= 8) strength++;         if (/[A-Z]/.test(password)) strength++;     ...

fixHTML

 <?php function fixHTML($html) {     libxml_use_internal_errors(true);     $doc = new DOMDocument();     $doc->loadHTML($html, LIBXML_HTML_NOIMPLIED | LIBXML_HTML_NODEFDTD);     libxml_clear_errors();     return $doc->saveHTML(); }  ?> ---------------------------------------------------------------------- <? = fixHTML ( htmlspecialchars_decode ( stripslashes ( $a [ 'body' ]))) ?>