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 Respuestas
+ 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?