Jaws Posted October 5, 2012 Share Posted October 5, 2012 i have this and i want it to check if both of them are true it comes up with yes, but if only one of them are true then i want it to come up as no. var n = 12; var m = 12; function myFunction() { if (n < 10,m != 20) { alert ("Yes"); } else { alert ("no"); } } Link to comment Share on other sites More sharing options...
ShadowMage Posted October 5, 2012 Share Posted October 5, 2012 (edited) Use && if (n<10 && m != 20) Have a look at the logical operators section on this page. Edited October 5, 2012 by ShadowMage 1 Link to comment Share on other sites More sharing options...
Jaws Posted October 5, 2012 Author Share Posted October 5, 2012 ahh thanks! Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now