0

I need to be able to check the following:

$(".main-menu a")

For a specific href attribute and then addClass

dcolumbus
  • 9,596
  • 26
  • 100
  • 165
  • More detail is going to allow us to actually help you. What exactly are you checking for in the `href` attribute? – Anthony Grist Jul 31 '12 at 21:36
  • Did you do any research before asking? Questions similar to this have been asked many, many times before. [for example](http://stackoverflow.com/questions/3105984/how-to-get-element-by-href-in-jquery) – MrOBrian Jul 31 '12 at 21:37
  • Yes I have MrOBrian ... but the plethora of questions mean a much wider net of possibilities. It doesn't hurt to ask in my own way. – dcolumbus Jul 31 '12 at 21:41

1 Answers1

6
$(".main-menu a[href='http://somesite.com']").addClass('someClass');
adeneo
  • 312,895
  • 29
  • 395
  • 388