Snap 't idee wel, maar 't werkt niet. Ik heb dus:
<body onload="javascript: inputnaampje.focus()">
en
<input type="text" name="zoekterm" size="40" class="formfield" id="inputnaampje">
En hij focust er dus niet op. Maar ik vraag me af, id zal ie toch interpreteren als een CSS-tag? moet 't niet iets anders zijn misschien?
----- EDIT ------------------------------------
Hij werkt nu, ik wist nu welke woorden ik op moest zoeken in Google en kwam op deze link:
http://javascript.internet.com/page-details/focus-onload.html
Daar staat deze code:
code:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
| <!-- TWO STEPS TO INSTALL FOCUS ONLOAD:
1. Add the onLoad event handler into the BODY tag
2. Copy the coding into the BODY of your HTML document -->
<!-- STEP TWO: Insert the onLoad event handler into your BODY tag -->
<BODY OnLoad="document.nameform.user.focus();"><!-- STEP ONE: Paste this code into the BODY of your HTML document -->
<!-- This script and many more are available free online at -->
<!-- The JavaScript Source!! http://javascript.internet.com -->
<center>
<form name="nameform">
Name: <input type=text name=user size=10>
</form>
</center>
<p><center>
<font face="arial, helvetica" size="-2">Free JavaScripts provided<br>
by <a href="http://javascriptsource.com">The JavaScript Source</a></font>
</center><p>
<!-- Script Size: 0.61 KB --> |