javascript color attribute
Translation results:
英['kʌlə(r)] 美[ˈkʌlɚ]
n.<Beauty> color, color; skin color, complexion, blood color; pigment, dye; essence
v .<Beauty>Coloring; changing the color of; whitewashing, rendering, coloring; blushing
Third person singular: colors Plural: colors Present participle: coloring Past tense: colored past participle : colored
javascript color attributesyntax
Function:Set the color of the text
Syntax: Object.style.color=color
javascript color attributeexample
<html> <head> <script type="text/javascript"> function setColor() { document.getElementById("p1").style.color="#ff0000"; document.getElementById("p2").style.color="magenta"; } </script> </head> <body> <p id="p1">This is an example paragraph</p> <p id="p2">This is also an example paragraph</p> <input type="button" onclick="setColor()" value="Change color of text" /> </body> </html>
Run instance »
Click the "Run instance" button to view the online instance
Popular Recommendations
- CSS Color Generator
- Building a Color Picker Extension
- Philips Hue announces new smart color Centura recessed spotlight
- Vivo X200 color options and camera specs emerge ahead of launch
- Lenovo reveals new color option for the 2024 Legion Y700 gaming tablet
- A Guide to Color Patterns in UI/UX Design: Methods and Best Practices