-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
79 lines (76 loc) · 2.27 KB
/
index.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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8"0>
<title>jQuery Placeholder Fix - Test Case</title>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.6.1/jquery.min.js"></script>
<script type="text/javascript" src="jquery.placeholder.fix.js"></script>
<script type="text/javascript">
$(document).ready(function(){
$('form#basic').placeholder();
$('form#force').placeholder({
force: true
});
$('form#style').placeholder({
force: true
});
});
</script>
<style type="text/css" media="screen">
#style input.placeholder{
color:#f00;
font-style: italic;
}
</style>
</head>
<body>
<h1>jQuery Placeholder Fix - Test Case</h1>
<h2>Basic Usage</h2>
<p>It will only apply the placeholder fix if the browser have no support to the placeholder attribute.</p>
<form action="#" method="get" id="basic">
<fieldset>
<input type="text" name="basic_field" id="basic_field" placeholder="Basic Placeholder" />
</fieldset>
</form>
<pre>
$(document).ready(function(){
$('form#basic').placeholder();
});
</pre>
<h2>Force placeholder</h2>
<p>It will force the placeholder even if the browser have support.</p>
<form action="" id="force" accept-charset="utf-8">
<fieldset>
<input type="text" name="force_field" id="force_field" placeholder="Force Placeholder" />
</fieldset>
</form>
<pre>
$(document).ready(function(){
$('form#force').placeholder({
force: true
});
});
</pre>
<h2>Add styles to the placeholder</h2>
<p>
It will add the class placeholder to the fields. You can style your placeholder
in the CSS file.
</p>
<form action="" id="style" accept-charset="utf-8">
<fieldset>
<input type="text" name="style_field" id="style_field" placeholder="Style Placeholder" />
</fieldset>
</form>
<pre>
//javascript
$(document).ready(function(){
$('form#color').placeholder();
});
//css
input.placeholder{
color: #f00;
font-style: italic;
}
</pre>
</body>
</html>