Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var $formulario = $('#formulario_terminado');
- $formulario.find('input[type="text"]').each(function() {
- $(this).data('valor-original', this.value);
- });
- $formulario.on('focus', 'input[type="text"]', function() {
- var $this = $(this);
- if ($this.val() === $this.data('valor-original')) {
- $this.val('');
- }
- });
- $formulario.on('blur', 'input[type="text"]', function() {
- var $this = $(this);
- if ($this.val().trim() === '') {
- $this.val($this.data('valor-original'));
- }
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement