Change element textDecoration: line-through : textDecoration « Style « JavaScript Tutorial






<html>
<head>
<title>A Simple Page</title>
<script language="JavaScript">
<!--
function addunderline()
{
    head1.style.textDecoration = "underline"
}

function removeunderline()
{
    head1.style.textDecoration = "none"
}

function addoverline()
{
    head1.style.textDecoration = "overline"
}

function addlinethrough()
{
    head1.style.textDecoration = "line-through"
}
//  -->
</script>
</head>
<body>
<h1 id="head1" onMouseover="addunderline()" onMouseout="removeunderline()"
onClick="addoverline()" ondblclick="addlinethrough()">Welcome to this page!</h1>
<P>A lot of interesting text goes here!</p>
</body>
</html>








22.14.textDecoration
22.14.1.Change element textDecoration: underline, none, overline
22.14.2.Change element textDecoration: line-through
22.14.3.div.style.textDecoration="underline";