Get Italic Element - Javascript DOM HTML Element

Javascript examples for DOM HTML Element:Italic


The Italic object represents an HTML <i> element.

You can access an <i> element by using getElementById():

Demo Code

ResultView the demo in separate window

<!DOCTYPE html>

<i id="myItalic">this italic text</i>

<button onclick="myFunction()">set the color</button>

function myFunction() {//from  www  .  java  2s  . c o  m
    var x = document.getElementById("myItalic"); = "red";


Related Tutorials