-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathjavascript-xss.html
More file actions
49 lines (36 loc) · 1.65 KB
/
javascript-xss.html
File metadata and controls
49 lines (36 loc) · 1.65 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
<!DOCTYPE html>
<html>
<head>
<title>Usefull things- Javascript</title>
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0-alpha1/dist/css/bootstrap.min.css" rel="stylesheet">
</head>
<body>
<div class="container mt-5">
<h1>DOM Manipulation and Other Functions Demo</h1>
<hr>
<h4>document.getElementById</h4>
<pre><code>var elementById = document.getElementById('example-get-element');</code></pre>
<h4 class="mt-4">document.getElementsByClassName</h4>
<pre><code>var elementsByClass = document.getElementsByClassName('example-class');</code></pre>
<h4 class="mt-4">document.querySelector</h4>
<pre><code>var querySelector = document.querySelector('#example-query-selector');</code></pre>
<h4 class="mt-4">document.querySelectorAll</h4>
<pre><code>var querySelectorAll = document.querySelectorAll('.example-query-class');</code></pre>
<h4 class="mt-4">document.cookie</h4>
<pre><code>document.cookie = 'name=John Doe; expires=Thu, 18 Dec 2023 12:00:00 UTC; path=/';</code></pre>
<h4 class="mt-4">alert</h4>
<pre><code>alert("This is an alert message!");</code></pre>
<h4 class="mt-4">prompt</h4>
<pre><code>var name = prompt("Please enter your name:", "John Doe");
if (name !== null) {
alert("Hello, " + name + "!");
}</code></pre>
<h4 class="mt-4">console.log</h4>
<pre><code>console.log("This message is logged to the console.");</code></pre>
<h4 class="mt-4">Print</h4>
<pre><code>window.print();</code></pre>
</div>
<!-- Bootstrap JS scripts -->
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0-alpha1/dist/js/bootstrap.bundle.min.js"></script>
</body>
</html>