A special character is a character that is not an alphabetic or numeric character. Punctuation marks and other symbols are examples of special characters. Unlike alphanumeric characters, special characters may have multiple uses. To prevent problems, some special characters may also need to be escaped or encoded when used in the command line and programming languages.
<input type="text" size="40" value="Write something cool here!" />
When defining an attribute in HTML, the double-quote symbol has a special meaning: it marks the start or end of the attribute value. Therefore, to include a double quote as part of an attribute value, the extended special HTML character code
" must be used instead:
<input type="text" size="40" value="Write something "cool" here!" />
In HTML, double quotes are only required around attributes that have text values. If the attribute value is a number, double quotes are not strictly required. For example,
size="40" are both valid attributes. However, it's good practice to surround all HTML attribute values in double quotes for legibility and consistency, even if the value is a number.
Special characters can be used in online forms for malicious reasons if they're not escaped or handled correctly. Some developers may not support special characters in their online forms.
Keyboard special characters
Below lists special characters available on the typical U.S. keyboard, with links to their related pages.
See our keyboard keys page for a full listing of keyboard keys.