Hallo!
Ich habe in selfthtml nicht gefunden, warum das onclick hier nicht funktioniert. Ich habe Firefox 1.5.0.1.
Zusatzfrage: Wie muss die Syntac lauten, damit ich im <Script>-Bereich etwas schreiben kann wie:
document.getElementById("pic1").onclick=Coords;
MfG
Dieter
****************************************************************
<html>
<head>
<title>test </title>
<script type="text/javascript">
function Coords (Ereignis) {
if (!Ereignis) {
Ereignis = window.event;
var newx = Ereignis.offsetX;var newy = Ereignis.offsetY;
} else {
var newx = Ereignis.pageX;var newy = Ereignis.pageY;
}
var pos = "x-Wert: " + newx + " / y-Wert: " + newy;
document.setquote.result.value = pos+ " hallo";
}
</script>
</head>
<body>
<img id="pic1" src="http://src.selfhtml.org/logo.gif" onclick="Coords(this)">
<form name="setquote" action=""><textarea name="result" cols="50" rows="10"></textarea>
<INPUT TYPE="SUBMIT" Value="Setit" name="setsubmit">
</form>
</body>
</html>