473,320 Members | 1,961 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

Need a function to remove HTML formating...

Does anyone has a function that will remove all HTML tags in some
string?

like

function removeFormating(str)

May 30 '07 #1
1 1422
On May 30, 1:43 pm, mbloc...@yahoo.com wrote:
Does anyone has a function that will remove all HTML tags in some
string?

like

function removeFormating(str)
In general, this should work:

var myString = '<b>some</b<a href="foo.html">text</a>';
myString = myString.replace(/<[^>]*>/g, '');
alert(myString); //result is 'some text'

so you want something like this:

function removeFormatting(str) {
return str.replace(/<[^>]*>/g, '');
}

May 30 '07 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: billbealey | last post by:
I'm struggling how to format out in a nice html table after doing a query. Query is: $result = mysql_query("SELECT state_name, county_name, party_name, votes FROM regions, county, party,...
11
by: Tony Johansson | last post by:
Hello! I have some problem with STL function remove I have two classes called Handle which is a template class and Integer which is not a template class. The Integer class is just a wrapper...
35
by: Boobie | last post by:
I need to escape HTML chracters so <test> --> &lt;test&gt; Looks like there is no built-in JS function...anyone got one handy ? thanks
1
by: Jurate | last post by:
Maybe somebody can suggest a way to invoke C# function from HTML page? -- Jurate
12
by: pake2007 | last post by:
Need To Remove Ms-access Bug#3420 Please Help- Every Time I Press To Move From One Record To Another A Get A Message Box (3420) How Can I Remove This From Popping Up Every Time? THANKS
1
by: Software Engineer | last post by:
Testing htmlspecialchars() PHP Function - Converting HTML Characters http://sqa.fyicenter.com/Online_Test_Tools/Test_htmlspecialchars_PHP_Function.php When data needs to be presented in Web...
3
by: zaggi | last post by:
Hi, I need to convert HTML file to any image file. I need to get it done in c#.NET only. Could you please suggest me some ways of doing it. Thanks, Zaggi
7
by: Redbeard | last post by:
I have a memo field that is supposed to be in paragraph format (with no returns) but half of the records are set up as point form with multiple returns. I have figured out how to remove the returns...
2
by: LindaDhasan | last post by:
Hi, I am a beginner with javascript.Please help me clarify how to display the result of a javascript function within html underline tag.PFA the code. <html> <head> <script...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.