MrAdam Posted November 18, 2006 Share Posted November 18, 2006 hi. im struggling to create an if statement using "!" to make it the oppsite sort of thing.here's what i have at the moment: if (curX >= left && curX <= fmRight) { // nothing to happen here } else { element = document.getElementById('menu'); element.parentNode.removeChild(element); } that works fine! .. but.. i don't want to have an else init. i've tried adding an "!" here: ... if !( ... ... but it just said error when i tried to run it?can anybody help?- thanks Link to comment Share on other sites More sharing options...
Webworldx Posted November 18, 2006 Share Posted November 18, 2006 You'd want the ! inside the bracket if(!variable_that_doesnt_exist){ ....do something when it cant find it} Why not just switch the math operators around though? < left and > fmRight, and use an || instead of &&? 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