chuyeow (owner)

Revisions

gist: 122922 Download_button fork
public
Public Clone URL: git://gist.github.com/122922.git
Embed All Files: show embed
newsletter signup.js #
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
// Clear newsletter textbox on focus if it contains the default text.
$('#newsletter_email').focus(function() {
 
  var value = $(this).val();
 
  // Clear the textbox if it's the default value.
  if (!$(this).data('default') || value == $(this).data('default')) {
    $(this).data('default', value);
    $(this).val('');
  }
}).blur(function() {
 
  if ($(this).val() == '') {
    $(this).val($(this).data('default'));
  }
});