Jump to content

explaination of onfocus="this.value='';


niche

Recommended Posts

I found this script, but can't find the explanation for why it works the way it does. Specifically, where does this.value come from? Can someone supply a reference?

Link to comment
Share on other sites

Oh you mean thee script? Thee script that everyone has been talking about for millennia?Also, could you post it? I seem to have lost my copy of thee script. :)

Link to comment
Share on other sites

onfocus="this.value=''"The onfocus attribute will run a specified script when the input is focused. This means when it's selected by clicking or tabbing. When a script is within an event attribute "this" refers to the element. The "value" property of the element refers to the text that's within it.Putting it all together: when the element is selected, the text it contains will be set to "" which means it will be emptied.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...