I just noticed, its not necessary anymore in Chrome to select elements that have an id e.g with getElementById
, you can directly call that element with its id
name... e.g "para1"
in this example:
<head>
<title>getElementById Beispiel</title>
<script>
function changeColor(newColor) {
para1.style.color = newColor;
}
</script>
</head>
<body>
<p id="para1">Irgendein Text</p>
<button onclick="changeColor('blue');">Blau</button>
<button onclick="changeColor('red');">Rot</button>
</body>
is there any more specification on this? didn't find anything about it on the internet..