can you varify the address for example if i do not have a "-" or a "st" then it prints out invalid so if i put 32-12 46st then it should
can you varify the address for example if i do not have a "-" or a "st" then it prints out invalid
so if i put 32-12 46st then it should be valid if anything else it says invalid
PLEASE DO NOT COPY THE OTHER GUYS THAT DID THIS
<!DOCTYPE html>
<html>
<head>
<title>document</title>
</head>
<body>
<input type="text" id="Address">
<label id="AddressLbl"></label>
<br><br>
<button onclick="clickme()">Click Here</button>
<script>
function clickme() {
if (document.getElementById("Address").value == "") {
document.getElementById('AddressLbl').innerHTML = 'Mandatory';
} else if (document.getElementById("Address").value == "-" || document.getElementById("Address").value == "st") {
document.getElementById('AddressLbl').innerHTML = 'valid';
} else {
document.getElementById('AddressLbl').innerHTML = 'invalid';
}
}
</script>
Step by step
Solved in 3 steps with 3 images