I`m just using a If statement with the logical operator. I dont know why it is showing sytax error.
var divWidth = $("#columnwraper").width(); //getting the width of the div
$("#right-button").click(function() {
if (cursor != totalWidth && totalWidth !< divWidth) {
$box2.animate({
marginLeft : "-=300"
}, "fast");
cursor += 100;
}
// console.log(colwidth.width());
});
It`s showing that
[15:18:24.050] SyntaxError: missing ) after condition.
What am I doing wrong here?
!<operator? Why you don't use>=instead?!=is one operator. It is not a combination of!and==. You cannot simply combine!with other operators (i.e.!<is invalid).