<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Clear default text from input boxes using Javascript</title>
	<atom:link href="http://www.tacticaltechnique.com/web-development/clear-default-text-from-input-boxes-using-javascript/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.tacticaltechnique.com/web-development/clear-default-text-from-input-boxes-using-javascript/</link>
	<description>Web development with Corey Salzano</description>
	<lastBuildDate>Fri, 03 Feb 2012 02:45:21 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
	<item>
		<title>By: Corey</title>
		<link>http://www.tacticaltechnique.com/web-development/clear-default-text-from-input-boxes-using-javascript/#comment-35405</link>
		<dc:creator>Corey</dc:creator>
		<pubDate>Mon, 20 Sep 2010 14:45:06 +0000</pubDate>
		<guid isPermaLink="false">http://www.tacticaltechnique.com/?p=478#comment-35405</guid>
		<description>Tim,

You could view the source of this page since I&#039;ve built a demo above. The two functions need to be placed in a script block like this:

&lt;p&gt;&lt;code&gt;&lt;script type=&quot;text/javascript&quot;&gt;
&lt;!--
function wash( anInput ){
if(anInput.value == anInput.defaultValue) anInput.value = &#039;&#039;;
}
function checkWash( anInput ){
if(anInput.value == &#039;&#039;) anInput.value = anInput.defaultValue;
}
//--&gt;
&lt;/script&gt;&lt;/code&gt;&lt;/p&gt;

Then, create a text box on your page with code like this:

&lt;p&gt;&lt;input type=&quot;text&quot; id=&quot;userName&quot; value=&quot;User name&quot; onfocus=&quot;wash(this);&quot; onblur=&quot;checkWash(this);&quot;&gt;&lt;/p&gt;

Your password text box should be type=&quot;password&quot; instead of type=&quot;text&quot;</description>
		<content:encoded><![CDATA[<p>Tim,</p>
<p>You could view the source of this page since I&#8217;ve built a demo above. The two functions need to be placed in a script block like this:</p>
<p><code>&lt;script type="text/javascript"&gt;<br />
&lt;!--<br />
function wash( anInput ){<br />
if(anInput.value == anInput.defaultValue) anInput.value = '';<br />
}<br />
function checkWash( anInput ){<br />
if(anInput.value == '') anInput.value = anInput.defaultValue;<br />
}<br />
//--&gt;<br />
&lt;/script&gt;</code></p>
<p>Then, create a text box on your page with code like this:</p>
<p>&lt;input type=&#8221;text&#8221; id=&#8221;userName&#8221; value=&#8221;User name&#8221; onfocus=&#8221;wash(this);&#8221; onblur=&#8221;checkWash(this);&#8221;&gt;</p>
<p>Your password text box should be type=&#8221;password&#8221; instead of type=&#8221;text&#8221;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Tim</title>
		<link>http://www.tacticaltechnique.com/web-development/clear-default-text-from-input-boxes-using-javascript/#comment-35403</link>
		<dc:creator>Tim</dc:creator>
		<pubDate>Mon, 20 Sep 2010 14:27:24 +0000</pubDate>
		<guid isPermaLink="false">http://www.tacticaltechnique.com/?p=478#comment-35403</guid>
		<description>Hi, I&#039;m trying to implement your code snippet and I&#039;m not sure where I need to place the code. I&#039;m building a website in wordpress and want the words &quot;username&quot; and &quot;password&quot; disappear in the input login boxes when someone clicks them. Your article sounds like it has the solution - could you tell me where to place the code? Thanks a lot in advance!</description>
		<content:encoded><![CDATA[<p>Hi, I&#8217;m trying to implement your code snippet and I&#8217;m not sure where I need to place the code. I&#8217;m building a website in wordpress and want the words &#8220;username&#8221; and &#8220;password&#8221; disappear in the input login boxes when someone clicks them. Your article sounds like it has the solution &#8211; could you tell me where to place the code? Thanks a lot in advance!</p>
]]></content:encoded>
	</item>
</channel>
</rss>

