Question: I am building a mobile site for a Motorola / IE 6 device.

For some reason that I can not come up with, jQuery's .select() function is working, but directly calling it in javascript is not.

```
<input type="text" id="lid" value="" class="as_done">

```

The jQuery way that works is this:

```
$('#lid').select();

```

The way that isn't working is this:

```
document.getElementById('lid').select();

```

---

This has me all sorts of confused. Any ideas as to why this is?

EDIT: I am not trying to do anything in jQuery. I am just trying to select the text inside the input box. I shouldn't need jQuery to do this, but the standard way is not working. <http://www.w3schools.com/jsref/met_text_select.asp>

Answer: 
Interesting change made it work for me. Perhaps this is a bug in windows mobile IE 6?

Consider the following html:

```
<input type="hidden" id="lid_as" name="lid" value="1">
<input type="text" id="lid" value="" class="as_done">

```

Calling `alert("document.getElementById('lid').name");` resulted in the message `lid`. This makes me think that it is grabbing the first input box whose ID is actually lid\_as.

When I moved the `lid_as` input below the `lid` box, the `select` function works properly.

So this HTML made it work:

```
<input type="text" id="lid" value="" class="as_done">
<input type="hidden" id="lid_as" name="lid" value="1">

```

Again, this question is in relation to WINDOWS MOBILE IE 6.
$() function returns a jquery object whereas document.getElementById returns a simple DOM object.