some
function createRange(a, b) {
const range = [];
for (let i = a; i <= b; i++) {
range.push(i);
}
return range;
}
const a = 1;
const b = 7;
const isRangedNumber= createRange(a, b);
let Validator = isRangedNumber.some((valid)=> valid === 5);
console.log(Validator);
form.submit()
if (e.key === 'Enter' && isValid) {
form.submit()
}
document.addEventListener('DOMContentLoaded', function() {
const forms = document.getElementsByTagName('form');
for (let form of forms) {
form.addEventListener('submit', function(event) {
event.preventDefault();
const formId = this.getAttribute('id');
const formNm = document.getElementById(formId);
const formData = new FormData(this);
fetch('mail.php', {
method: 'POST',
body: formData
})
//axios.post('mail.php', { body: formData })
.then(response => response.text())
.then(data => {
formNm.innerHTML = data;
})
.catch(error => {
formNm.innerHTML = error;
});
});
}
});
function getTestIndex(domain, string) {
const regex = new RegExp(`^(?:@|(?:https?://)?(?:www\\.)?${domain}/?(\\w+)?)$`);
const result = regex.exec(string);
return result ? result[1] : null;
}
console.log(getTestIndex('testdomain.com', 'https://testdomain.com/testindex'));
$(".wayWeWork").hover(
function () {
$(this).find("h4").animate({top: '20%',left: '5rem'},300, 'linear');
},
function() {
$(this).find("h4").animate({top: '50%',left: '2rem'},300, 'linear');
});