Hallo Franz,
<script type="text/javascript">
function hintergrundfocus(name)
{
window.document.kontakt.eval(name).style.backgroundColor="#000000";
}
</script>
<form name="kontakt">
<input name="firma" onFocus="hintergrundfocus(this.name)"><br>
</form>
Bist du sicher, dass eval() eine Methode des Formularobjekts namens "kontakt" ist?
Warum überhaupt so umständlich?
<input name="firma" onFocus="[code lang=javascript]style.backgroundColor='#000000');
">[/code]
oder, wenn du das mit mehreren Input-Feldern machst eben:
<input name="firma" onFocus="[code lang=javascript]hintergrundfocus(this));
">[/code]
mit einer Funktion:
hintergrundfocus(obj) {
obj.style.backgroundColor='#000000';
}
Gruß Gernot