Follow along with the video below to see how to install our site as a web app on your home screen.
Anmerkung: This feature may not be available in some browsers.
<head>
<title>change color on a tag by click</title>
<script language="javascript">
function change(){
document.getElementById('id_1').style.color="#000"
}
</script>
</head>
<body>
<a href="#" id="id_1" onclick="change()">click me</a>
</body>
<html>
<head>
<style>
#id_1
{
background-color: #ccc;
border: #008 double 4px;
width: 100%;
}
</style>
</head>
<body>
<h1>Überschrift</h1>
<hr>
<br /><br /><br />
<table id="id_1">
<tr>
<td style="color: #999;">td 1</td>
<td style="color: #f00;">td 2</td>
</tr>
</table>
<br />
<button onclick="document.getElementById("id_1").style.color='black';">Schriftfarbe ändern</button>
</body>
<table id="meineid" class="colorstandard">
<tr>
<td class="erste">bla</td>
<td class="zweite">blubb</td>
</tr>
</table>
.colorstandard .erste { color: red; }
.colorstandard .zweite { color: blue; }
.colors2 .erste { color: red; }
.colors2 .zweite { color: blue; }
document.getElementById("Tabelle").className = "colors2";