Editing JavaScript 1 Document Objekt
Jump to navigation
Jump to search
Warning: You are not logged in. Your IP address will be publicly visible if you make any edits. If you log in or create an account, your edits will be attributed to your username, along with other benefits.
The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then publish the changes below to finish undoing the edit.
Latest revision | Your text | ||
Line 326: | Line 326: | ||
<body> | <body> | ||
<form name="formular"> | <form name="formular"> | ||
<p><input id=" | <p><input id="feld1" value="Formularfeld 1"> </p> | ||
<p><input id=" | <p><input id="feld2" value="Formularfeld 2"></p> | ||
<button id="btn1" type="button">Feld 1 Fokus</button> | <button id="btn1" type="button">Feld 1 Fokus</button> | ||
<button id="btn2" type="button">Feld 2 Fokus</button> | <button id="btn2" type="button">Feld 2 Fokus</button> | ||
Line 335: | Line 335: | ||
// leert zuerst das Input Feld und | // leert zuerst das Input Feld und | ||
//setzt dann den Fokus darauf | //setzt dann den Fokus darauf | ||
feld1.value = ""; | |||
feld1.focus(); | |||
} | } | ||
function fokus2() { | function fokus2() { | ||
feld2.value = ""; | |||
feld2.focus(); | |||
} | } | ||
btn1.onclick = fokus1; | btn1.onclick = fokus1; |