Recently I required to remove HTML tags from html page. For that I have used following function which removes all HTML tags.
Source Code
Paste Your Source code into designated area.For Example.
<p><strong>Input code:</strong>
(<em>Note: Processing is done on the "input-code" id</em>)</p>
<pre>
<code id="input-code">
<h2>About</h2>
<p>Here you will find post about how to remove HTML tag from a string using
javascript.<p>
<p><a href="/about">Read more</a></p>
External File
Create RemoveHTML.js external file and paste following code.
function removeHTMLTagFromString()
{
if (document.getElementById && document.getElementById("input-code"))
{
var strHtmlCode = document.getElementById("input-code").innerHTML;
/* It replaces escaped brackets with real ones,
i.e. < is replaced with < and > is replaced with > */
strHtmlCode = strHtmlCode.replace(/&(lt|gt);/g,
function(strMatch, p1)
{
return (p1 == "lt") ? "<" : ">";
});
var strTagStrippedText = strHtmlCode.replace(/<\/?[^>]+(>|$)/g, "");
alert("Output text:\n" + strTagStrippedText);
}
}
{
if (document.getElementById && document.getElementById("input-code"))
{
var strHtmlCode = document.getElementById("input-code").innerHTML;
/* It replaces escaped brackets with real ones,
i.e. < is replaced with < and > is replaced with > */
strHtmlCode = strHtmlCode.replace(/&(lt|gt);/g,
function(strMatch, p1)
{
return (p1 == "lt") ? "<" : ">";
});
var strTagStrippedText = strHtmlCode.replace(/<\/?[^>]+(>|$)/g, "");
alert("Output text:\n" + strTagStrippedText);
}
}
Head
import javascript file into head section of HTML document.
import javascript file into head section of HTML document.
<script type="text/javascript" src="removeHTML.js"></script>
Body
Paste the code into BODY section, which HTML Tag you want to remove in HTML document.
<p><strong>Input code: </strong>( <em>Note: Processing is done on the "input-code" id </em>)</p>
<pre>
<code id="input-code">
<h2>About</h2>
<p>Here you will find post about how to remove HTML tag from a string using
javascript.<p>
<p><a href="/about">Read more </a></p>
</code>
</pre>
<a href="#" onclick="removeHTMLTagFromString(); return false;">
»Click to remove all HTML tags from the input code </a>.
<pre>
<code id="input-code">
<h2>About</h2>
<p>Here you will find post about how to remove HTML tag from a string using
javascript.<p>
<p><a href="/about">Read more </a></p>
</code>
</pre>
<a href="#" onclick="removeHTMLTagFromString(); return false;">
»Click to remove all HTML tags from the input code </a>.
67 comments:
Really a great post. Thanks for sharing this unique information with us. I get admired by reading your post. Keep on Blogging
Datawarehousing Training in Chennai
Remowing HTML tags from the string is not a difficult thing to do.
The best thing is that your blog really informative thanks for your great information!
erp in chennai
Cinematographer in jaipur
Great post and very helpful for me.Thanks for share this post
Escorts service in jaipur
good knowledge for your post thanks
The article shares very meaningful information, at least for me. Thanks for sharing, my friend! Please visit my website hope you enjoy it
jaipur call girls service
jaipur call girls service
chittorgarh call girls service
vip call girls in jaipur
vip call girls in jaipur
vip call girls in chittorgarh
call girls service jaipur
call girls service jaipur
call girls service chittorgarh
The using a function of this kind will allow you to remove the tags without any additional operations. However, we should upload the appropriate files for this.
This is the best place where we can get good collection of information with very useful stuff...
Best Online Software Training Institute | HTML5 CSS3 Training
It is a great post. Keep sharing such kind of useful information.
http://easyblogging
Article submission sites
Good job! Fruitful article. I like this very much. It is very useful for my research. It shows your interest in this topic very well. I hope you will post some more information about the software. Please keep sharing!!
ccna course in Chennai
ccna Training in Chennai
ccna Training institute in Chennai
ccna institute in Chennai
German Classes in Chennai
German Language Classes in Chennai
Very interesting content which helps me to get the indepth knowledge about the technology. To know more detils about the course visit this website.
Qtp training in Chennai
Big Data Training in Chennai
Hadoop Training in Chennai
Android Training in Chennai
Selenium Training in Chennai
Digital Marketing Training in Chennai
JAVA Training in Chennai
Java classes in chennai
I read your blog regularly from the beginning. It was very impressed to me and I learn huge of information from your blog. Thank you!!!
Ethical Hacking Course in Chennai
Hacking Course in Chennai
Certified Ethical Hacking Course in Chennai
Ethical Hacking Training in Chennai
I was in search of this blog for a while and just now got this into my vision. Thanks for sharing.
Spoken English Classes in OMR Chennai
Spoken English Classes in Perungudi
Spoken English Classes in Velachery
Spoken English Classes in Medavakkam
Spoken English Classes in Tambaram
Spoken English Class in Chrompet
Spoken English Class in Ambattur
Spoken English Classes in Ambattur OT
Such an excellent and interesting blog, Do post like this more with more information, This was very useful, Thank you.
Aviation Academy in Chennai
Aviation Courses in Chennai
best aviation academy in chennai
aviation institute in chennai
This is really impressive post, I am inspired with your post, do post more blogs like this, I am waiting for your blogs.
air hostess training in Bangalore
air hostess academy Bangalore
cabin crew training institute in Bangalore
air hostess training center in Bangalore
Learned a lot from your blog. Good creation and hats off to the creativity of your mind. Share more like this.
Loadrunner Training in Chennai
French Classes in Chennai
iOS Training in Chennai
Android Training in Chennai
Software testing training in chennai
Thanks for sharing such a nice info.I hope you will share more information like this. please keep on sharing!
Angularjs Training in Chennai
Angularjs course in Chennai
Web Designing Course in chennai
PHP Training in Chennai
Hadoop Training in Chennai
AngularJS Training in OMR
AngularJS Training in Tambaram
This is really too useful and have more ideas and keep sharing many techniques. Eagerly waiting for your new blog keep doing more.
CCNA Course in Chennai
CCNA Training in Chennai
Cloud Computing Courses in Chennai
AWS Training in Chennai
Data Science Course in Chennai
CCNA Training in Porur
CCNA Training in Adyar
I was searching an excellent blog in this topic, thanks admin for the info on latest technology.
Software testing training in chennai
JAVA Training in Chennai
Hadoop Training in Chennai
Selenium Training in Chennai
German Classes in chennai
PHP Training in Chennai
PHP Training
I read the post and I have really enjoyed your blogs posts. Looking for the next post.
Aviation Academy in Chennai
Air hostess training in Chennai
Airport management courses in Chennai
Ground staff training in Chennai
Medical coding training in Chennai
Fashion designing courses in Chennai
Interior design courses in Chennai
It was very great, this is the worthy concept and good efforts. Really helpful for me and I will share this post with my friends. I like more updates from your blog...
TOEFL Coaching in Chennai
TOEFL Training in Chennai
IELTS Coaching in Chennai
Spoken English Classes in Chennai
TOEFL Coaching in OMR
TOEFL Coaching in Tambaram
In the beginning, I would like to thank you much about this great post. Its very useful and helpful for anyone looking for tips. I like your writing style and I hope you will keep doing this good working.
Data Science Course in Chennai
Data Science Training in Chennai
Blue Prism Training Chennai
AWS Training in Chennai
Digital Marketing Course in Chennai
Data Science Training in Porur
Data Science Training in Adyar
Data Science Training in Velachery
the article is awesome and verymuch helpful for my study.keep sharing more like this.
RPA Training in Chennai | Robotics Process Automation Training in Chennai | RPA course in Chennai | Blue Prism Training in Chennai | Blue Prism Training Institute in Chennai | RPA Training in Velachery | RPA Training in Tambaram
the ideas used in this article is really good.i want this type of information.thankyou so much.
Data Science Course in Chennai
Data Science Training in Chennai
Data Analytics Courses in Chennai
Machine Learning Course in Chennai
Machine Learning Training in Chennai
Data Science Training in Velachery
Data Science Training in Tambaram
You are doing a great job. I would like to appreciate your work for good accuracy
Regards,
PHP Training in Chennai | PHP Course in Chennai
This was really a great blog which is comprehensive but has a good content in it.
Computer Education Franchise
Education Franchise India
Computer Center Franchise
Education Franchise Opportunities in India
Education Franchise India
Spoken English Franchise
Franchise For Spoken English Classes
Top Education Franchise in India
Best Education Franchise in India
best hand blender in india
Its a wonderful post and very helpful, thanks for all this information. You are including better information regarding this topic in an effective way. T hank you so much.
Spoken English Class in Coimbatore
Best Spoken English institute in Coimbatore
Spoken English Training in coimbatore
best IELTS Coaching in Coimbatore
IELTS Training Coimbatore
German language classes in Coimbatore
Learn German Language in Coimbatore
Its a wonderful post and very helpful, thanks for all this information. You are including better information regarding this topic in an effective way
Blue Prism Training in Chennai
DevOps Training in Chennai
MVC Training in Chennai
123movies
whatsapp group links
arts whatsapp groups
outsourcingall.com "Nice and helpful information provided by you. Thanks Buddy
free seo training in dhaka bangladesh
Freelancing Training Center
Best Website Development and Design Company in Bangladesh
Great post and informative blog.it was awesome to read, thanks for sharing this great content to my vision.
Good discussion.
best german classes in chennai
german classes in madurai
german language course in madurai
german language coaching centres in coimbatore
best german classes in bangalore
best german classes in chennai
Resources like the one you mentioned here will be very useful to me ! I will post a link to this page on my blog. I am sure my visitors will find that very useful...
MSBI Online Training
MSBI Course Certification
Great post and informative blog.it was awesome to read, thanks for sharing this great content to my vision.
Good discussion.
German Language Classes in Chennai
German Courses in Chennai
german language classes in bangalore
german courses in bangalore
german language classes in coimbatore
german coaching classes in coimbatore
german language course in madurai
german classes in hyderabad
german language classes in hyderabad
Delhi Mathura Vrindavan Tour by Bus
Agra Mathura Tour Package by Bus
Delhi to Agra tour by Volvo bus
Online Bus Ticket Booking for Agra
Same Day Agra Tour
Same Day Agra Tour by Bus
DevOps Training in Chennai
I am glad that I have visited this blog. Really helpful, eagerly waiting for more updates.
Best Article buy Pain Pills online Excellent post. I appreciate this site. Stick with it! Because the admin of this web page is working, no doubt very quickly it will be well-known, due to its quality contents.This website was how do you say it? Relevant!! Finally, I’ve found something that helped me.
Best Article buy Roxicodone online Excellent post
buy Xanax online
buy Oxycodone online
Best Article buy Pain Medications online Excellent post. I appreciate this site. Stick with it! Because the admin of this web page is working, no doubt very quickly it will be well-known, due to its quality contents.This website was how do you say it? Relevant!! Finally, I’ve found something that helped me.
buy Research Chemicals online
buy Roxicodone online
buy Cbd Isolate online
Great Article. Thank you for sharing! Really an awesome post for every one.
IEEE Final Year projects Project Centers in Chennai are consistently sought after. Final Year Students Projects take a shot at them to improve their aptitudes, while specialists like the enjoyment in interfering with innovation. For experts, it's an alternate ball game through and through. Smaller than expected IEEE Final Year project centers ground for all fragments of CSE & IT engineers hoping to assemble. Final Year Project Domains for IT It gives you tips and rules that is progressively critical to consider while choosing any final year project point.
JavaScript Training in Chennai
JavaScript Training in Chennai
Nice article. I liked very much. All the informations given by you are really helpful for my research. keep on posting your views.
ccna course in bangalore
ccna course in Chennai
ccna Training in Chennai
ccna course in marathahalli
ccna training institutes in btm
ccna course in Coimbatore
ccna course in Madurai
ccna training in madurai
ccna training in coimbatore
The best thing is that your blog really informative thanks for your great information!
This is the best place where we can get good collection of information with very useful blog
Great post I must say and thanks for the information. Education is definitely a sticky subject. it is still among the leading topics of our time. I appreciate your post and looking for more.mobile phone repair in Fredericksburg
mobile phone repair in Fredericksburg
mobile phone repair in Fredericksburg
mobile phone repair in Fredericksburg
mobile phone repair in Fredericksburg
mobile phone repair in Fredericksburg
mobile phone repair in Fredericksburg
mobile phone repair in Fredericksburg
mobile phone repair in Fredericksburg
mobile phone repair in Fredericksburg
mywifiext
mwifiext.net
123.hp.com
123.hp.com/setup
san diego seo expert
seo company in india
mywifiext
mywifiext local
mywifiext.local
www.mywifiext.local
Great Article
Cloud Computing Projects
Networking Projects
Final Year Projects for CSE
JavaScript Training in Chennai
JavaScript Training in Chennai
The Angular Training covers a wide range of topics including Components, Angular Directives, Angular Services, Pipes, security fundamentals, Routing, and Angular programmability. The new Angular TRaining will lay the foundation you need to specialise in Single Page Application developer. Angular Training
Great Article
big data projects for cse final year students
Java Training in Chennai
Final Year Projects for CSE
Java Training in Chennai
gmat coaching classes in chennai
Having a good score in GMAT is very important to get into your dream university. Choose the best GMAT coaching centres in Chennai from the list.
angularjs interview questions for experienced
Important AngularJS Interview Questions and Answers for freshers and experienced to get your dream job in Angular! Basic & Advanced AngularJS Interview Questions for Freshers & Experienced.
BUY WEED ONLINE
pineapple express online cheap sale in usa
buy nova og online
buy afghan kush online
buy nova-og-kush online
buy valuim online
buy ketamine rocks online
buy nebutal online
buy cocaine online
iboga for sale
buy ibogaine hcl online
buy ibogaine hcl online
buy ibogaine online
buy iboga root barks online
buy iboga powder online
tabernanthe ibogaine hcl for sale
ibogaine hcl research
iboga for sale
BUY WEED ONLINE
BUY OXYCODONE ONLINE
BUY IBOGAINE ONLINE
BUY DANK VAPES ONLINE
BUY PURPLE QUEEN ONLINE
BUY IBOGAINE CAPSULES ONLINE
BUY SUBUTEX 8MG ONLINE
BUY GELATO DANK VAPES CARTRIDGE ONLINE
top 10 javascript interview questions
Important Javascript Interview Questions and Answers for freshers and experienced to get your dream job & Advanced Javascript Interview Questions for Freshers & Experienced.
Great experience for me by reading this blog. Thank you for the wonderful article.
android developer interview questions
android interview questions for senior developer
android interview questions medium
rpa interview questions and answers for experienced
angularjs interview questions
angularjs interview questions and answers for experienced
php interview questions and answers
This blog is really nice and informative blog, The explanation given is really comprehensive and informative.
php interview questions and answers
php interview questions for freshers
php interview questions for experienced
angularjs interview questions for experienced
angularjs interview questions
angularjs interview questions and answers for experienced
software testing interview question and answer
software testing interview questions and answers for experienced
This is good site and nice point of view.I learnt lots of useful information.
hadoop interview questions and answers
hadoop interview questions and answers for experienced
java interview questions for experienced
selenium interview questions and answers for experienced
digital marketing interview questions and answers pdf
oracle pl sql interview questions
data scientist interview questions and answers
python interview questions and answers for experienced
Excellent blog, good to see someone is posting quality information. Thanks for sharing this useful information. Keep up the good work.
php interview questions for freshers
php interview questions for experienced
php technical interview questions
rpa interview questions and answers for experienced
angularjs interview questions
angularjs interview questions and answers for experienced
php interview questions and answers
Nice blog was really feeling good to read it. Thanks for this information.
networking interview questions with answers
ccna interview questions and answers for freshers
networking interview questions and answers
rpa interview questions and answers pdf
rpa interview questions and answers for experienced
ethical hacking interview questions
ethical hacking interview questions and answers
javascript interview questions
This blog is really nice and informative blog, The explanation given is really comprehensive and informative.
rpa interview questions
rpa interview questions and answers
rpa interview questions and answers pdf
nodejs interview questions
nodejs interview questions and answers
php interview questions and answers
php interview questions for freshers
The information given in this blog is very nice and i like it if you share more this kind of blog and i also have written this kind of blog you can also read for more knowledge.
php interview questions for freshers
php interview questions for experienced
php basic interview questions
software testing interview questions and answers pdf
rpa interview questions and answers pdf
rpa interview questions and answers for experienced
php interview questions and answers
php interview questions for freshers
software testing interview question and answer
Đặt vé tại phòng vé Aivivu, tham khảo
giá vé máy bay đi Mỹ khứ hồi
giá vé máy bay đà lạt sài gòn
chuyến bay chu lai hà nội
giá vé máy bay đi nha trang vietnam airline
giá vé máy bay đi Huế pacific airline
bảng giá taxi sân bay nội bài
combo du lịch đà nẵng
It is an excellent post! Truly very worthy concept and really thanks for this posting such a wonderful blog. Share more info like this.
Informatica Training in Velachery
Web Designing course in Velachery
Salesforce course in Chennai
Thanks for sharing such a helpful, and understandable blog. I really enjoyed reading it.
Robots for kids
Robotic Online Classes
Robotics School Projects
Programming Courses Malaysia
Coding courses
Coding Academy
coding robots for kids
Coding classes for kids
Coding For Kids
I have read your blog its very attractive and impressive. I like it your blog.
interview questions on digital marketing
digital marketing interview questions and answers for freshers
digital marketing interview questions and answers pdf
Post a Comment