I am new to javascript/jQuery and am trying to add a css class to an element if the page's url **does not match** one of three strings. I cannot these lines of my code to work.

```
  if (window.location.href.match(/(interests|ideas|art)/) > -1) {
    jQuery("#nav-about").addClass('active');
  }

```

Any ideas? Is my syntax incorrect?

**EDIT:**

It seems like the answers everyone has given me should be working, but they aren't. Maybe other lines of my code are conflicting:

```
$(document).ready(function() {
  if (window.location.href.search(/(interests|ideas|art)/) > -1) {
      jQuery("#nav-about").addClass('active');
  }
  if (window.location.href.match(/(interests)/) != null) {
    jQuery("#nav-interests").addClass('active');
  }
  if (window.location.href.match(/(ideas)/) != null) {
    jQuery("#nav-ideas").addClass('active');
  }
  if (window.location.href.match(/(art)/) != null) {
    jQuery("#nav-art").addClass('active');
  }
});

```

My site is [benxd.me](http://benxd.me). The link, `#nav-about` on this main page is what needs the class `active`; the script does not work on this page. The script on the other pages, interests, ideas and photography work.