Home
About
Contact
Home
Features
_Multi DropDown
__DropDown 1
__DropDown 2
__DropDown 3
_ShortCodes
_SiteMap
_Error Page
Learn Blogging
Documentation
Video Documentation
Download This Template
Home
Nuralom(admin)
December 15, 2022
browsers:
Javascript decoding the HTML
1
2
3
4
5
6
function
htmlDecode
(
input
)
{
let
doc
=
new
DOMParser
(
)
.
parseFromString
(
input
,
"text/html"
)
;
return
doc
.
documentElement
.
textContent
;
}
alert
(
htmlDecode
(
"<img src='img.jpg'>"
))
;
// "<img src='myimage.jpg'>"
alert
(
htmlDecode
(
"<img src='dummy' onerror='alert(/xss/)'>"
))
;
// ""
Run >
Reset
The function
Post a Comment
0 Comments
Social Plugin
Tags
Recent Posts
7/recent/post-list
Search This Blog
Comments
Categories
Beecrowd Solution
(1)
C++ Solution
(2)
Toph Solution
(1)
Beecrowd Solution
3/Beecrowd Solution/post-list
Popular Posts
beecrowd | 1002 Area of a Circle | c++ Solution.
Is Palindrome | Toph | Easy Problem c++
0 Comments