Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR HTML

conditions option in html

<form action="" onsubmit="myFunction()">
    <label for="fname">First name:</label><br>
    <input type="text" id="fname" name="fname" value=""><br>
    <label for="lname">Last name:</label><br>
    <input type="text" id="lname" name="lname" value=""><br><br>
    <input type="submit" value="Submit">
</form> 
<script type="text/javascript">
   function myFunction(){
     var fname = document.getElementById("fname").value;
     if(fname == '<>')
        alert("Condition met")
   }
</script>
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #conditions #option #html
ADD COMMENT
Topic
Name
3+8 =