Is is possible to select specific text string on the page directly without a id, class, etc…
I have this text string “ERROR: AffiliateID invalid” that I would like to remove from the page.
Is it possible?
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.
This should solve the problem imho:
The code replaces all occurences of the string with empty string.
EDIT: Use it only if you’re 100 percent positive that it won’t break your HTML in any way.
EDIT 2:
I don’t know about a specific jQuery function for this. I found this tip:
1) http://johannburkard.de/blog/programming/javascript/6-quick-jquery-tips-text-manipulation-timers-and-elements.html
The example uses the same replace function as the version in pure javascript. The function comes from JavaScript 1.2 (the standard that is 10 years old and is implemented in all major browsers). So I guess there’s no reason to use a function from jQuery.
2) There is a plugin for replacing text in specified HTML tags. Maybe it is worth trying.