AW: AW: [Javascript] Re: <select> focussieren

Michael Borchers borchers at tridem.de
Tue Feb 8 07:20:29 CST 2005


> -----Ursprüngliche Nachricht-----
> Von: Matt Barton [mailto:javascript at mattbarton.org]
> Gesendet: Dienstag, 8. Februar 2005 14:14
> An: [JavaScript List]
> Betreff: Re: AW: [Javascript] Re: <select> focussieren
> 
> 
> You live and learn.  Thanks Roger.
> 
> M
> 
> Roger Roelofs wrote:
> > Matt,
> > 
> > On Feb 8, 2005, at 7:58 AM, Matt Barton wrote:
> > 
> >> Oh - also, sorry, just noticed:
> >>
> >> getElementById() is a method of the document object, not 
> of the form 
> >> (as far as I'm aware), so instead of:
> >>
> >> document.reparatur.getElementById("art").focus();
> >>
> >> try:
> >>
> >> document.getElementById("art").focus();
> > 
> > 
> > Actually I think getElementbyId is a method of the node 
> object, so I 
> > think it should work either way.
> > 
> > 
> > Roger

good it helped you:)

so here is the complete code that should work,
but it won't, neither with a form name and document.formname
or without document., am i missing something?

<html>
<head>
<title></title>
</head>

<body>

<script language="JavaScript" type="text/javascript">
document.getElementById("art").focus();
</script>

<form action="" method="get">

<table width="100%">  
  <tr> 
    <td>
	  <select name="art" id="art">
	    <option value=""></option>
	    <option value="A">A</option>
	    <option value="D">D</option>
	    <option value="I">I</option>
	    <option value="L">L</option>
	    <option value="T" selected>T</option>
	    <option value="Text">Text</option>
	    <option value="F">F</option>
	  </select>
    </td>  
  </tr>
</table>
</form>



More information about the Javascript mailing list