-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathplugin.html
More file actions
55 lines (52 loc) · 1.92 KB
/
plugin.html
File metadata and controls
55 lines (52 loc) · 1.92 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
49
50
51
52
53
54
55
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>JS Alert | by Alaa Badran</title>
<link rel="stylesheet" type="text/css" href="http://netdna.bootstrapcdn.com/bootstrap/3.0.0/css/bootstrap.min.css" />
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.1/jquery.min.js"></script>
<script src="//netdna.bootstrapcdn.com/bootstrap/3.0.0/js/bootstrap.min.js"></script>
<script src="./jsalert.js"></script>
</head>
<body>
<div class="container">
<h1>JS Alert</h1>
<div class="row">
<div class="col-md-12">
<p>Welcome to my simple code. This is a functionality to override alert() into a customizable alert() with fancy look.</p>
<p>
<form role="form">
<div class="form-group">
<textarea name="alert_message" id="alert_message" class="form-control" placeholder="Enter your message here, you can use HTML tags."></textarea>
</div>
<div class="form-group">
<button id="jsalert" class="btn btn-primary">Show alert</button>
</div>
</form>
</p>
<p>
Code used above:
<h4>HTML</h4>
<pre>
<div class="form-group">
<button id="jsalert" class="btn btn-primary">Show alert</button>
</div>
</pre>
<h4>Javascript</h4>
<pre>
$('#jsalert').on('click', function (e){
e.preventDefault();
var msg_text = $('#alert_message').val();
alert(msg_text); // You can put a second param to edit alert title.
});
</pre>
</p>
<p>
<h3>Demo</h3>
See it in action: <a href="http://rawgithub.com/alaabadran/js-alert/master/index.html">Raw Github - JS Alert</a>
</p>
</div>
</div>
</div>
</body>
</html>