-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathexample.html
41 lines (37 loc) · 1.58 KB
/
example.html
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
<head>
<link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet"
integrity="sha384-EVSTQN3/azprG1Anm3QDgpJLIm9Nao0Yz1ztcQTwFspd3yD65VohhpuuCOmLASjC" crossorigin="anonymous">
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js"
integrity="sha384-MrcW6ZMFYlzcLA8Nl+NtUVF0sA7MsXsP1UyJoMp4YLEuNSfAP+JcXn/tWtIaxVXM"
crossorigin="anonymous"></script>
<script src="emailmagic.js" async defer></script>
</head>
<body>
<div class="container text-center" id="container">
<h1>Make those pesky mailto links be useful for once.</h1>
<h3>Try it below! Uses Bootstrap 5.</h3>
<p class="mt-5">
<a class="btn btn-primary" href="mailto:[email protected]">Email me!</a>
</p>
<p>
<a class="btn btn-primary"
href="mailto:[email protected][email protected],[email protected]&subject=Something&body=Hmm...&[email protected]">What
if we make it more complicated?</a>
</p>
<p>
<button class="btn btn-secondary" onclick="add_example_mailto_link()">Add a mailto link</button>
</p>
</div>
<script>
function add_example_mailto_link() {
let p = document.createElement('p');
let mailto_link = document.createElement('a');
mailto_link.href = 'mailto:[email protected]';
mailto_link.innerText = 'Email me!';
mailto_link.classList.add('btn', 'btn-primary');
p.appendChild(mailto_link);
document.getElementById("container").appendChild(p);
emailMagic();
}
</script>
</body>