Welcome guest. Before posting on our computer help forum, you must register. Click here it's easy and free.
Computer Hope forum e-mail issues and down time
0 Members and 1 Guest are viewing this topic.
<html><script type="text/javascript">{var x=20;var y=10;if x==20{document.write("TRUE STATEMENT");}else{document.write("FALSE STATEMENT");}}</script></html>
I forgot to put the condition [if] in parentheses.
Code: [Select]<script type="text/javascript">{var x=20;var y=10;if x==20{document.write("TRUE STATEMENT");}else{document.write("FALSE STATEMENT");}}</script>
<script type="text/javascript">{var x=20;var y=10;if x==20{document.write("TRUE STATEMENT");}else{document.write("FALSE STATEMENT");}}</script>
<script type="text-javascript">var x=20;var y=10;if x==20{document.write("TRUE STATEMENT");}else{document.write("FALSE STATEMENT");}</script>
javascript is so specific geez
Errr.....You actually put in too many parentheses in there.Unless it's a function which will be called later, you can use it this way:Code: [Select]<script type="text-javascript">var x=20;var y=10;if x==20{document.write("TRUE STATEMENT");}else{document.write("FALSE STATEMENT");}</script>If that's the case, then forget what I said about learning PHP or ASP.
<script type="text-javascript">var x=20;var y=10;if (x==20){document.write("TRUE STATEMENT");}else{document.write("FALSE STATEMENT");}</script>
Do I not need parentheses around the condition? Like that.if (x==20)