We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent b8cb1f2 commit 397e6b8Copy full SHA for 397e6b8
scripts/jquery.placeholder.js
@@ -0,0 +1,28 @@
1
+// (c) https://gist.github.com/823300, https://gist.github.com/379601
2
+
3
+jQuery.placeholder = function() {
4
+ $('[placeholder]').focus(function() {
5
+ var input = $(this);
6
+ if (input.hasClass('placeholder')) {
7
+ input.val('');
8
+ input.removeClass('placeholder');
9
+ }
10
+ }).blur(function() {
11
12
+ if (input.val() === '') {
13
+ input.addClass('placeholder');
14
+ input.val(input.attr('placeholder'));
15
16
+ }).blur().parents('form').submit(function() {
17
+ $(this).find('[placeholder]').each(function() {
18
19
20
21
22
+ });
23
24
25
+ $(window).unload(function() {
26
+ $('[placeholder]').val('');
27
28
+};
0 commit comments