charset (HTML attribute)
charset attribute defines the character encoding
used in a linked script file (which is referred to by the
src attribute). You’d use
this attribute when the character encoding employed by the external
external script file has the following script:
If the document that links to
this eternal file is declared as using
encoding, the alert text would be unreadable nonsense. Adding
charset="utf-8" to the
tag makes it display correctly.
This example shows a
script file that’s using a slightly different character
encoding from the default
attribute takes as its value a space and/or a comma-delimited list of
character sets, as set out in RFC 2045 (a
fun bit of bedtime reading).
This attribute is
generally well supported, but strangely appears to have fallen off the
supported attribute list with Opera version 10. Using the simple alert
test shown above, earlier versions of Opera displayed the characters
correctly, but Opera 10 behaved as if no
was specified at all, making the alert
There are no comments yet.