JavaScript Reference/Javascript Properties/fgColor

Материал из Web эксперт
Версия от 11:21, 26 мая 2010; Admin (обсуждение | вклад) (1 версия)
(разн.) ← Предыдущая | Текущая версия (разн.) | Следующая → (разн.)
Перейти к: навигация, поиск

"fgColor" Example

   <source lang="javascript">
   

<html> <body> Sample Text
<button onclick="document.fgColor="red";">Red</button> <button onclick="document.fgColor="blue";">Blue</button> </body> </html>


     </source>
   
  


"fgColor" is applied to

   <source lang="javascript">

+----------------+--------------------------------------------------------------+ | Applied_To |document | +----------------+--------------------------------------------------------------+

     </source>
   
  


"fgColor" Syntax and Note

   <source lang="javascript">

Note: Read and write property. Sets the text colort.

Value: Web color name or hexadecimal value in #RRGGBB format.

Syntax:

document.fgColor = value document.body.fgColor = value // NN6, IE


     </source>