getQuery=(name)=>{
    return document.querySelectorAll(name);
}
getId=(idName)=>{
    return document.getElementById(idName);
}
let requiredFeild = getQuery(".required");
let requiredInput = getQuery("input");
let validateButton = getId("validationButton");
console.log(requiredFeild);
feildValidate=()=>{
    let validateFunction=true;
requiredFeild.forEach((data)=>{
    if(data.value==""){
        data.classList.remove("required");
        data.classList.add("requiredvalue");
        validateFunction=false;
        console.log(data);
    }
    else{
        data.classList.remove("requiredvalue");
        data.classList.add("required");
    }
});
console.log(validateFunction);
return validateFunction;
}
validateButton.addEventListener("click",function(){
    if(!feildValidate())
    {
        return;
    }
    console.log("yes");
    getId("submitButton").click();
});
requiredInput.forEach((data)=>{
    data.addEventListener("focus",function(){
        data.classList.remove("requiredvalue");
        data.classList.add("required");
    })
    data.addEventListener("keyup",function(){
        data.classList.remove("requiredvalue");
        data.classList.add("required");
    })
    data.addEventListener("change",function(){
        data.classList.remove("requiredvalue");
        data.classList.add("required");
    })
});