Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

sanitize html in JavaScript

/**
 * @param {string} text
 * @return {string}
 */
function sanitizeHTML(text) {
  return $('<div>').text(text).html();
}
COPY
Comment

javascript sanitize html

// Checks if the string has a <script> tag
Checker = new RegExp(`<[^>]*script`).test(`<script>`)
console.log(Checker)
Comment

PREVIOUS NEXT
Code Example
Javascript :: end session express 
Javascript :: vue 3 install eslint 
Javascript :: js overflowx 
Javascript :: how to find last element of an array 
Javascript :: firebase functions add to database 
Javascript :: how to use the map method in javascript 
Javascript :: how make calender in bootstrap 
Javascript :: video conferencing app with html and js 
Javascript :: swr npm 
Javascript :: how to check empty object js 
Javascript :: angular property value does not exist on type Event 
Javascript :: set id to div element in Javascript 
Javascript :: a href javascript 
Javascript :: run for loop every second js 
Javascript :: how to get variable from url in javascript 
Javascript :: check if array contain the all element javascript 
Javascript :: express route parameters 
Javascript :: obfuscation js 
Javascript :: jquery add css important 
Javascript :: componentdidmount in functional component 
Javascript :: jquery a tag click 
Javascript :: chrome dino game 
Javascript :: adding commas after thousand 
Javascript :: divide an array based on length js 
Javascript :: JavaScript Element fade out 
Javascript :: connect existing database with sequelize 
Javascript :: proxy api javascript get 
Javascript :: on window resize js 
Javascript :: update to node 15.11 
Javascript :: xmlhttprequest status codes 
ADD CONTENT
Topic
Content
Source link
Name
8+6 =