niche Posted June 14, 2011 Share Posted June 14, 2011 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 More sharing options...
MrFish Posted June 14, 2011 Share Posted June 14, 2011 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 More sharing options...
Ingolme Posted June 14, 2011 Share Posted June 14, 2011 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 More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.