With the checklist script below, how do I make the letters dim to gray while making the strikethrough a bright red? I know it has something to do with placing one class that holds the text within another that holds the strikethrough and the text, but I just can't get it.

And I've heard HTML5 doesn't support this, and only supports <del>. Is there a way to apply the script below to accomodate that as well? Any help on any of this would be awesome. Thanks all!

<html>
<head>
<title>Untitled</title>
<script type="text/javascript">
<!--
function toggle(box,theId) {
    if(document.getElementById) {
        var cell = document.getElementById(theId);
        if(box.checked) {
            cell.className = "on";
        }
        else {
            cell.className = "off";
        }
    }
}
// -->
</script>
<style type="text/css">
<!--
.listcheck{
font-size:20px;
font-weight:bold;
padding-left:5px;
}
.off {
color: #000;
}
.on {
color: #bbb;
text-decoration: line-through;
}
-->
</style>
</head>
<body>
<table border="0" cellpadding="5" cellspacing="0">
<tr><td class="off" id="cell1">
<input type="checkbox" onclick="toggle(this,'cell1')"><span class="listcheck">Yada Yada Yada</span>
</td></tr>
<tr><td class="off" id="cell2">
<input type="checkbox" onclick="toggle(this,'cell2')"><span class="listcheck">Yada Yada Yada</span>
</td></tr>
</table>
</body>
</html>

Yes, I saw that exact page. Only problem is it looks like I would need it in the css since I'm trying to replace one css with another. I'm not sure if you can do that with a style tag hooked noto the actual element, can you?

Thanks for replying either way.

"Yup" might be right. That looks like the answer I need is somewhere in there. Combining classes seems to be the route. Good find. I was on the uijquery page looking through demos, didn't see that site.

If you can give me any hints on how to apply it, throw em my way. Other than that, thanks a ton!

Awesome. I'm about to go out to a movie, but if you still need the help when I get back I'll take a look.

That's more than perfect. Thank you so much. I hope that movie was great. I really do appreciate your time and effort... as effortless as all this appears to be for you :-)

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.