Javascript examples for DOM HTML Element:Emphasized
The Emphasized object represents an HTML <em> element.
You can access an <em> element by using getElementById():
<!DOCTYPE html> <html> <body> <em id="myEm">this emphasized text</em> <button onclick="myFunction()">set the color</button> <script> function myFunction() {/*from w w w . j a va 2s . co m*/ var x = document.getElementById("myEm"); x.style.color = "red"; } </script> </body> </html>