<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	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/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Zack Perdue &#187; javascript placeholder</title>
	<atom:link href="http://zackperdue.com/tag/javascript-placeholder/feed" rel="self" type="application/rss+xml" />
	<link>http://zackperdue.com</link>
	<description>My Personal Blog and Portfolio</description>
	<lastBuildDate>Fri, 17 May 2013 15:24:57 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	
		<item>
		<title>Default Text Field Value without Javascript (placeholder)</title>
		<link>http://zackperdue.com/tutorials/html5-placeholder-without-javascript</link>
		<comments>http://zackperdue.com/tutorials/html5-placeholder-without-javascript#comments</comments>
		<pubDate>Thu, 26 Jan 2012 20:58:19 +0000</pubDate>
		<dc:creator>Zack</dc:creator>
				<category><![CDATA[Plugins]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[html5 form]]></category>
		<category><![CDATA[html5 placeholder]]></category>
		<category><![CDATA[input on focus]]></category>
		<category><![CDATA[javascript placeholder]]></category>
		<category><![CDATA[jquery placeholder]]></category>
		<category><![CDATA[js placeholder]]></category>
		<category><![CDATA[placeholder support]]></category>

		<guid isPermaLink="false">http://zackperdue.com/?p=637</guid>
		<description><![CDATA[Don't use JavaScript where you can do the same thing with HTML or CSS! This is how you make your forms have default values that clear when you give focus to them without using JavaScript.<div class='yarpp-related-rss'>

Related posts:<ol>
<li><a href='http://zackperdue.com/plugins/hide-form-input-values-on-focus-with-jquery' rel='bookmark' title='Hide Form Input Values On Focus With jQuery'>Hide Form Input Values On Focus With jQuery</a> <small>This is a simple and light weight JavaScript snippet using...</small></li>
</ol>
<img src='http://yarpp.org/pixels/fb6bed01d38e39f483fa90e1942f330b'/>
</div>
]]></description>
				<content:encoded><![CDATA[<p>A reader commented on <a href="http://zackperdue.com/plugins/hide-form-input-values-on-focus-with-jquery/" title="Hide Form Input Values On Focus With jQuery" target="_blank">one of my other posts</a> about a JavaScript method that may be less taxing on the users browser. He pointed out how my js script for hiding form input values on focus could be improved. </p>
<p>Turns out there is a handy little method: <code>textObject.defaultValue</code>. Instead of using the <code>.val()</code> method, it would be slightly better to use the one he mentioned. </p>
<p>However, I have another way, which I hope most of you know about already, but I will put it out there just to make sure. Its an HTML5 attribute called <strong>placeholder</strong>.</p>
<p>It looks like this:</p>
<pre>&lt;input type=&quot;text&quot; placeholder=&quot;Your Placeholder Text&quot; /&gt;</pre>
<p>Which renders like:<br />
<input type="text" placeholder="Your Placeholder Text" /><br />
Go ahead and click in the text field and click out of it. The placeholder does what JavaScript use to do!</p>
<p>There is even a way to style the placeholder text with css&#8230; like so:</p>
<pre>
::-webkit-input-placeholder {
   color: #ccc;
}

:-moz-placeholder {
   color: #ccc;
}
</pre>
<h4>Long Story Short</h4>
<p>Don&#8217;t use JavaScript where you can do the same thing with HTML or CSS! However, my script with the updated methods would be a good fallback for browsers that do not support placeholder text. Also, big thanks to Karl Ringrose for pointing out the js method!</p>
<p>Thanks and Happy Coding!</p>
<div class='yarpp-related-rss'>
<p>Related posts:</p><ol>
<li><a href='http://zackperdue.com/plugins/hide-form-input-values-on-focus-with-jquery' rel='bookmark' title='Hide Form Input Values On Focus With jQuery'>Hide Form Input Values On Focus With jQuery</a> <small>This is a simple and light weight JavaScript snippet using...</small></li>
</ol>
<img src='http://yarpp.org/pixels/fb6bed01d38e39f483fa90e1942f330b'/>
</div>
]]></content:encoded>
			<wfw:commentRss>http://zackperdue.com/tutorials/html5-placeholder-without-javascript/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
<!-- This Quick Cache file was built for (  zackperdue.com/tag/javascript-placeholder/feed ) in 0.13334 seconds, on Jun 19th, 2013 at 3:21 am UTC. -->
<!-- This Quick Cache file will automatically expire ( and be re-built automatically ) on Jun 19th, 2013 at 4:21 am UTC -->