Posts

Showing posts with the label HTML 5

HTML 5: Placeholder

The placeholder attribute shows text  or short hint in a field intended to help user in data entry. The text will be disappear until the field is focused upon, then hides the text.  Placeholder text is supported by Firefox 3.7+ and Chrome/Safari 4.0+ Example: <input type="text" name="FirstName" value="" placeholder="First Name"> Output will be: Now, when IE and Opera is being used your placeholder won't work. To work for your placeholder we need to do some javascript.  /* This will check if your browser supports placeholder */ jQuery(function() { jQuery.support.placeholder = false; test = document.createElement('input'); if('placeholder' in test) jQuery.support.placeholder = true; }); /* This will transfer your placeholder to your input value */ $(function() { if(!$.support.placeholder) { var active = document.activeElement; $(':text').focus(function () { if ($(this).attr(...

HTML 5: SPELLCHECK

Image
SpellCheck specifies if the element must have its spelling and grammar checked. The spellcheck attribute specifies whether the element should have its spelling checked. The following text can be spellchecked: The text values in input elements (not password)  The text in <textarea> elements The  text in editable elements. BROWSER COMPATIBILITY Markup 3.0.6 1.0.154.48   3.2.1 9.62 <input type=text> offer on right-click no check check as you type offer on right-click <input type=text spellcheck=true> check as you type no check check as you type offer on right-click <input type=text spellcheck=false> offer on right-click no check check as you type offer on right-click <input type=text spellcheck> invalid offer on right-click no check check as you type offer on right-click <input type=text spellcheck=spellcheck>   invalid offer on right-click no check check as you type offer on right-click <input type=text ...