Reputation: 574
This has got to be simple. Why am I getting the error missing ) after argument list
on this jQuery? All the (
and )
are closed. I tried escaping the quotes, too.
$(".state-button").on("click", function(e) {
if ($(".record.state:contains("AR")").length > 0) { //Error on this line
$(".record").toggleClass("display-block");
e.preventDefault();
});
}
Upvotes: 0
Views: 36
Reputation: 10646
This is proper
$(".state-button").on("click", function(e) {
if ($(".record.state:contains('AR')").length > 0) {
$(".record").toggleClass("display-block");
e.preventDefault();
}
}); <-- here
Upvotes: 1