I have following string in javascript.
str = '<a href="/display/1">This is link</a>';
I want to get "This is link" from above string but not succeeded.
I tried this also
str.innerHTML
but getting undefined
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.
A string is not a DOM object.
The variable you have –
stris a string, the innerHTML property only exists on DOM (Document Object Model) nodes, so you’ll have to convert to that first to use this approach.Or with jQuery