Remove html tags from ahref title tag

I have an app with the following markup in the code snippet below.

Works great but how can I remove the html tags from the ahref title tag?

The title tag is the href tooltip so when you hover over the link it displays the contents of "AnglerBio" but as this was inputted via rich text editor I get all the markup as well.  I just want the text
<a href="AnglerBio.aspx?bioId=<%#Eval("bId")%>" title="<%#Eval("AnglerBio")%>">

Open in new window

Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.


add the following javascript to your page and call removeHTMLTags for AnglerBio content

/* This script and many more are available free online at
The JavaScript Source!!
Created by: Robert Nyman | */
function removeHTMLTags(){
       if(document.getElementById && document.getElementById("input-code")){
             var strInputCode = document.getElementById("input-code").innerHTML;
                    This line is optional, it replaces escaped brackets with real ones,
                    i.e. < is replaced with < and > is replaced with >
              strInputCode = strInputCode.replace(/&(lt|gt);/g, function (strMatch, p1){
                    return (p1 == "lt")? "<" : ">";
             var strTagStrippedText = strInputCode.replace(/<\/?[^>]+(>|$)/g, "");
             alert("Output text:\n" + strTagStrippedText);      
   // Use the alert below if you want to show the input and the output text
   //            alert("Input code:\n" + strInputCode + "\n\nOutput text:\n" + strTagStrippedText);      
mugseyAuthor Commented:
Could you give me an example of how to call the javascript please using my code snippet
mugseyAuthor Commented:
Infact I am using and the tooltip works fine when I run the app locally using cassini - its when I deploy onto dev server using IIS that the markup id displayed
Determine the Perfect Price for Your IT Services

Do you wonder if your IT business is truly profitable or if you should raise your prices? Learn how to calculate your overhead burden with our free interactive tool and use it to determine the right price for your IT services. Download your free eBook now!

Akin DeluI’m a software engineer, tech enthusiast and UI/UX lover. Commented:
Is you a anchor in a grid?

It was not a good idea with javascript

use .net function

public static string StripHtml(string html, bool allowHarmlessTags)
   if (html == null || html == string.Empty)
     return string.Empty;

   if (allowHarmlessTags)
     return System.Text.RegularExpressions.Regex.Replace(html, "", string.Empty);

   return System.Text.RegularExpressions.Regex.Replace(html, "<[^>]*>", string.Empty);


<a href="AnglerBio.aspx?bioId=<%#Eval("bId")%>"
title="<%#this.StripHTML(Eval("AnglerBio"), false) %>">

# this.GetItemUrl( Eval("sku") as string )

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
mugseyAuthor Commented:
OK thanks

Yes I think the .net option is better but would this strip out ALL html tags?


actually it must remove all XML tags, i.e. everything between "<" and ">"

mugseyAuthor Commented:
OK thanks

but I get compiler error

StripHtm(string, bool)' has some invalid arguments

this is markup

title="<%#this.StripHtm(Eval("Body"), false) %>">
mugseyAuthor Commented:
Infact I got the error to remove when I took out the "this" keyword
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.