jquery unescape html

Solutions on MaxInterview for jquery unescape html by the best coders in the world

showing results for - "jquery unescape html"
Samuel
11 Apr 2016
1<script>
2var encodedStr = "This is fun &amp; stuff";
3var decoded = $("<div/>").html(encodedStr).text();
4console.log(decoded);
5</script>
6
7<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
8<div/>
Ida
22 Jun 2017
1var encodedStr = "This is fun &amp; stuff";
2var decoded = $("<div/>").html(encodedStr).text();
3console.log(decoded);
4
5
6<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
7<div/>
8
Muhammad
30 Oct 2017
1function decodeEntities(encodedString) {
2  var textArea = document.createElement('textarea');
3  textArea.innerHTML = encodedString;
4  return textArea.value;
5}
6
7console.log(decodeEntities('1 &amp; 2')); // '1 & 2'