Hellihello
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>jsundclassname</title>
<style type="text/css">
body {color:yellow;font-weight:bold}
div.klasse1 {background-color:green}
div.klasse2 {background-color:blue}
div.klasse3 {background-color:red}
</style>
<script>
meineFunktion = function () {
div_testId = document.getElementById("testId");
alert("Klasse bisher: "+ div_testId.className + "--- wird sich gleich ändern");
div_testId.className="klasse3";
}
</script>
</head>
<body>
<div class="klasse1" id="testId">
Inhalt1
</div>
<div class="klasse1">
Inhalt2
</div>
<div class="klasse2">
Inhalt3
</div>
<button onclick="meineFunktion()">meineFunktion()</button>
</body>
</html>
???
Gruß,
frankx