-
Notifications
You must be signed in to change notification settings - Fork 0
/
example.html
34 lines (29 loc) · 1.09 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
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8" />
<title></title>
<script src="https://code.jquery.com/jquery-2.2.3.min.js" integrity="sha256-a23g1Nt4dtEYOj7bR+vTu7+T8VP13humZFBJNIYoEJo=" crossorigin="anonymous"></script>
<script type="text/javascript" src="dist/jquery.uniqueId.min.js"></script>
</head>
<body>
<div id="test_1_x">
<span id="span_1"></span>
<span id="span_2"></span>
<span id="span_3"></span>
</div>
<div id="test_2_x">
<div data-attribute="test_x1"></div>
<div data-attribute="test_x2"></div>
<div data-attribute="test_x3"></div>
</div>
<script type="text/javascript">
console.log($.uniqueId({counter_start:50})); //return uid_50;
console.log($.uniqueId()); //return uid_1
console.log($.uniqueId({prefix:'span_'})); //return span_4
console.log($.uniqueId({attribute:'data-attribute',prefix:'test_x'})); //return test_x4
console.log($.uniqueId({prefix:'test_'})); //return test_1
console.log($.uniqueId({prefix:'test_',suffix:'_x'})); //return test_3_x
</script>
</body>
</html>