Re: Remove value of input element onfocus
- From: "Max" <max@xxxxxxx>
- Date: Fri, 23 Sep 2005 00:18:52 GMT
> The value attribute is a primitive string, so it is always passed
> by value. In other words, "x" is a new variable containing the
> same value as the argument. Changing it only changes the copy.
>
> On the other hand, the keyword "this" is a reference to an Object, so
> if you pass it, you can change the attributes of the Object that it
> refers to. Also, you probably want to use the onfocus handler, not
> the onclick:
>
> function removeinput(x) {
> if (x.value == 'Enter items not on standard list here...') {
> x.value = '';
> }
> }
>
> onfocus="removeinput(this);"
Thanks a bunch. It works great, and now I understand a bit more about the
concept.
.
- References:
- Remove value of input element onfocus
- From: Max
- Remove value of input element onfocus
- Prev by Date: Re: Help with tricky "select all" problem
- Next by Date: Re: Remove value of input element onfocus
- Previous by thread: Re: Remove value of input element onfocus
- Next by thread: Help with tricky "select all" problem
- Index(es):
Relevant Pages
|