I need to remove the class which have a specific string.
I did try the following but it does not work.
<body class="myClass someStringAndOtherString"></body>
$('body').removeClass('class', ':contains("someString")');
Any ideas?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
To remove the class ‘someString’ do the following:
To remove all classes if the ‘someString’ class is found:
To remove a class that contains a string:
LIVE DEMO
Or here it is as a function:
LIVE DEMO
then it would be: