# Anchor
click_link 'Save'
# Button
click_button 'awesome'
# Both above
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| $(function() { | |
| if (!('placeholder' in document.createElement('input'))) { | |
| $('input[placeholder], textarea[placeholder]').each(function() { | |
| var text = this.getAttribute('placeholder'); | |
| var fld = $(this); | |
| function setPlaceholder() { | |
| if (fld.val() == text || fld.val() == '') { | |
| fld.addClass('jqPlaceholder'); | |
| fld.val(text); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| enablePlaceholders: function() { | |
| if (!('placeholder' in document.createElement('input'))) { | |
| // enable <input placeholder> for browsers not drinking HTML5 kool-aid | |
| $('input[placeholder]').each(function() { | |
| var $this = $(this); | |
| var placeholder = $this.attr('placeholder'); | |
| var insert_placeholder = function() { | |
| if ($this.val() === '') { | |
| $this.val(placeholder); |