how to compare and call function in javascript
Hello im just studiing javascript and im making a form where it will ask
for a start address and a destination address. What i want to do but cant
figure out is how i can get javascript to compare the two value if my
input box and if it exist on the function it will show a messege, but if
it doesnt exist it will still loop till it finds the value and show the
messege or show an error if it really dont have anything.
base on this HTML form
<div id="panel">
<form>
<input type="text" placeholder="Start Address" id="start" >
<input type="text" placeholder="Destination Address" id="end">
<input type="button" value="Get Direction" id="SubmitBtn"
onclick="printme()" >
</form>
</div>
<div id="infopanel">
</div>
example : if start and end is equal to plane ride show "you must ride a
plane " or if start and end is equal to boat ride show " you must ride a
boat" or if start and end is equal to bus ride show " you must ride a bus"
else show you cant go there.
No comments:
Post a Comment