I’m in need of a bit of a jQuery hack for this WordPress project. It’s generating links with data-filters but no unique IDs or anything.
<a data-filter=".term73" href="#">
And I’d like to manually tell .term73 to have class “active” when the page loads. I’ve used the addClass() function before, but can’t seem to find how to do that to an element by data-filter (as opposed to ID). Ideas?
Like this?
or even
just to point out how you can target attributes.
While I’m at it, an alternative which might be good to know, but overkill for this scenario: