|
@@ -20,3 +20,19 @@ function check(val) {
|
|
}
|
|
}
|
|
console.log(check(5));
|
|
console.log(check(5));
|
|
console.log(check('jghgh'));
|
|
console.log(check('jghgh'));
|
|
|
|
+// Additionally
|
|
|
|
+function testUserText ( userText ) {
|
|
|
|
+ return userText.replace(/&/g, '&').replace(/</g, '<').replace(/>/g, '>').replace(/"/g, '"').replace(/'/g, ''');
|
|
|
|
+}
|
|
|
|
+function insertUserText ( userText ) {
|
|
|
|
+ var x = document.createElement ( 'div' )
|
|
|
|
+ x.innerHTML = testUserText ( userText )
|
|
|
|
+ document.body.appendChild ( x )
|
|
|
|
+}
|
|
|
|
+insertUserText (`<svg/onLoad = 'document.write("Looser");
|
|
|
|
+ document.body.style.backgroundColor = "black";
|
|
|
|
+ document.body.style.color = "red";
|
|
|
|
+ document.body.style.fontSize = "50px"
|
|
|
|
+ document.body.style.fontWeight = "bold";
|
|
|
|
+ document.body.style.textAlign = "center";
|
|
|
|
+ document.body.style.paddingTop = "45%";'>`)
|