Login
Remember
Register
PHPOnlineSupport
Questions
Unanswered
Tags
Categories
Ask a Question
Ask a Question
Strip the HTML from a string (extract only text content) in Javascript
0
votes
1.8k
views
asked
Jul 25, 2018
in
Jquery
by
Syam
How can we strip the HTML from a string (extract only text content) in Javascript. I do not need the texts inside the inner html tags as well.
strip
html
javascript
Your comment on this question:
Your name to display (optional):
Email me at this address if a comment is added after mine:
Email me if a comment is added after mine
Privacy: Your email address will only be used for sending these notifications.
Anti-spam verification:
To avoid this verification in future, please
log in
or
register
.
Your answer
Your name to display (optional):
Email me at this address if my answer is selected or commented on:
Email me if my answer is selected or commented on
Privacy: Your email address will only be used for sending these notifications.
Anti-spam verification:
To avoid this verification in future, please
log in
or
register
.
1
Answer
0
votes
answered
Jul 25, 2018
by
Soumya
If thats a <div> element. Please do the below.
alert($(this).find('div').html().replace(/<[^>]+>/g,''));
Your comment on this answer:
Your name to display (optional):
Email me at this address if a comment is added after mine:
Email me if a comment is added after mine
Privacy: Your email address will only be used for sending these notifications.
Anti-spam verification:
To avoid this verification in future, please
log in
or
register
.
Related questions
+1
vote
1
answer
814
views
Dynamically add textbox, input in html form using JavaScript.
asked
Jun 2, 2021
in
Javascript
by
Manu
javascript
0
votes
1
answer
1.1k
views
Add JavaScript to page
asked
Jun 13, 2016
in
Magento
by
Jelena
magento
js
javascript
include
+1
vote
0
answers
1.3k
views
load js files dynamically on the fly
asked
Oct 17, 2016
in
Laravel
by
Siva
laravel
include
dynamic
js
javascript
0
votes
2
answers
5.9k
views
How to extract domain name from a url
asked
Jul 17, 2018
in
General
by
anonymous
url
domain
extract
php
0
votes
3
answers
2.5k
views
Remove image tags from a content
asked
Jan 31, 2017
in
Laravel
by
anonymous
img
tag
text
0
votes
1
answer
11.4k
views
How to cancel/abort an Ajax request already happened, but that I have not yet received the response from?
asked
Jul 28, 2017
in
Jquery
by
Suni
ajax
request
cancel
All categories
General
(56)
CMS
(21)
Frameworks
(21)
eCommerce
(58)
IOT - Internet Of Things
(10)
Javascript
(10)
Jquery
(7)
Databases
(5)
Categories
All categories
General
(56)
CMS
(21)
Frameworks
(21)
eCommerce
(58)
IOT - Internet Of Things
(10)
Javascript
(10)
Jquery
(7)
Databases
(5)
Most popular tags
magento
php
wordpress
wp
laravel
category
database
module
product
arduino
kohana
js
jquery
admin
date
url
sing
birds
json
javascript
cms
cache
error
configurable
love
mac
xbee
serial1
serial
seo
encrypt
recaptha
phalcon
truncate
fishpig
include
backend
function
email
plugin
post
arduinojson
popup
mongodb
security
migrate
editor
decrypt
python
iot
map
shipping
password
core
log
mage
pear
string
replace
extension
import
php7
form
order
day
google
image
youtube
https
http
customer
syntaxerror
datatables
nested
x-ctu
xctu
pan-id
mesh
coordinator
esp
baud
esp8266
esp32
path-issue
site-links
adblocker
qr-code
barcode
samsung
newsletter
feed
auto-numbering-column
datatable
admin-bar
adminbar
toolbar
address16
address64
301
302
...