I need to strike all the text based on the element id using javascript.
How to do this?
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.
The easiest way to go using vanilla javascript should be just to manipulate the HTML content itself. This could look like:
Using jQuery, this task becomes only slightly more trivial by using
.contents()+.wrapAll():Another alternative, using css might also be an idea:
Or again using jQuery to be more cross-browser compliant: