Member Avatar for zentsang

OK... so here's the deal. I have tried multiple Google and forum searches to no avail. Maybe it's they way I'm searching but this is a last resort.

I'm trying to have a page (HTML and Javascript mix) that a user can input a few lines of code into. Then either automatically or by clicking a Convert button ... the HTML tags from the input box can be stripped away leaving plain text that is outputted to a new textarea that the user can then copy and paste elsewhere.

Example... the user types or pastes the following into the input <textarea>:

<SERVER>whatsawhosit.com</SERVER>
<DOC>1246</DOC>
<ID>34266</ID>

Then either automatically or clicking a button, it converts to the following in a new text box:

whatsawhosit.com/1246:34266

I don't know how to say it any other way. Input text with HTML tags ... Output to plain text formatting like a URL.

Can anyone help? This is not a classroom project, it's just something I'm trying to figure out and the HTML/Javascript manuals I've gone through and the many searches online are only giving me bits and pieces or insight... but nothing seems quite similar.

I know how to create the input and output textareas and how to create a clickable button. I just cant figure out the stripping HTML tags and outputting plain text part.

Thanks in advance to any takers.

-ZenTsang
"Long Live The Soil Monkeys!!"

Recommended Answers

All 3 Replies

Member Avatar for zentsang

pixelsoul ... diafol...

You 2 rock!

That is exactly what I needed. Both of your examples are great!

Oh and thanks for not hitting me with a lmgtfy.com reference like I've seen so many other do.

If I could buy you both your drinks of choice... I would. I really appreciate your help.

-ZenTsang
"Long Live The Soil Monkeys!!"

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.