Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

jQuery select all anchors that have a certain class

Tags:

html

jquery

I'm trying to access all anchors in the page that has a certain class using jQuery

For example. access all anchors that have class "bold"

I tried

$('.bold');

But I only need to select the anchors, can you please help me?

Thank you in advance

like image 864
Jason Statham Avatar asked Dec 01 '25 06:12

Jason Statham


2 Answers

Use the following selector:

$('a.bold');
like image 117
Mohammad Anini Avatar answered Dec 03 '25 20:12

Mohammad Anini


Wouldn't $('a.bold'); be what you need?

like image 32
j08691 Avatar answered Dec 03 '25 19:12

j08691



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!