0
How to remove a particular class using JQuery?
In jQuery you can remove all the class or idâs or even Element using .hide(), But if Iâm having, 5 Paragraph Element, where all of them has the same class name âabcdeâ How to particularly remove the content of class âabcdeâ inside the 3rd or 4th paragraph? Hope someone answers! đ
7 RĂ©ponses
+ 1
You can use .eq() Raaja Thalapathy. B
Here's a working code
https://code.sololearn.com/W5aJdG4norYy/?ref=app
+ 1
Raaja Thalapathy. B the argument that you pass to .removeClass() is the name of the class that you want to remove.
So, for example
$('div').removeClass('namehere');
This removes the class 'namehere' from all divs.
+ 1
Oh Thanks Jonathan Pizarra ! I get it
But how do u particularly pick a particular elementâs class (like i asked in the question above) 3rd or 4th Paragraph and remove only that particular paragraphâs content?
+ 1
Wow! đ
Thanks a lot Jonathan Pizarra for taking time to show me as code! Really appreciate,
No wonder why they gave you Moderator Status đ
Thanks again man đđđ»
+ 1
You are welcome Raaja Thalapathy. B đ
0
$('.class').removeClass('class_to_remove');
0
Yuri Biasi
Correct me if im wrong,
I use,
$(â.classâ) is the Class name we are reffering to jQuery,
.removeClass(â3â) means the 3rd Element which has âclassâ as its name?
Am i wrong?