• 🌙 Community Spirit

    Ramadan Mubarak! To honor this month, Crax has paused NSFW categories. Wishing you peace and growth!

Email counter/ Wrong email remover script (1 Viewer)

Currently reading:
 Email counter/ Wrong email remover script (1 Viewer)

Recently searched:

harchaoui2

Member
LV
1
Joined
Nov 9, 2023
Threads
10
Likes
4
Awards
4
Credits
666©
Cash
0$
this is the script, like and share it :
<!DOCTYPE html>
<html>
<head>
<title>Email Counter and Wrong Email Remover</title>
</head>
<body>
<h1>Email Counter and Wrong Email Remover</h1>

<!-- Input area for entering email addresses -->
<label for="emailInput">Enter email addresses (comma-separated):</label>
<input type="text" id="emailInput" placeholder="e.g., email1@example.com, email2@example.com">
<button onclick="countAndRemoveEmails()">Count & Remove</button>

<!-- Display the count and removed emails -->
<p>Total Email Count: <span id="emailCount">0</span></p>
<p>Incorrect Emails Removed: <span id="removedEmails"></span></p>

<script>
function countAndRemoveEmails() {
// Get the input value and split it into an array of email addresses
const emailInput = document.getElementById("emailInput").value;
const emailArray = emailInput.split(",").map(email => email.trim());

// Initialize variables to keep track of the count and removed emails
let emailCount = 0;
let removedEmails = [];

// Regular expression for validating email format
const emailRegex = /^[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,}$/;

// Iterate through the email array
for (let i = 0; i < emailArray.length; i++) {
const email = emailArray;
if (emailRegex.test(email)) {
// Valid email, increment count
emailCount++;
} else {
// Invalid email, add it to the list of removed emails
removedEmails.push(email);
}
}

// Update the HTML to display the count and removed emails
document.getElementById("emailCount").textContent = emailCount;
document.getElementById("removedEmails").textContent = removedEmails.join(", ");
}
</script>
</body>
</html>
 

Create an account or login to comment

You must be a member in order to leave a comment

Create account

Create an account on our community. It's easy!

Log in

Already have an account? Log in here.

Tips
Recently searched:

Similar threads

Users who are viewing this thread

Top Bottom