Input-Tag Feature-Detection in JQuery
<p>Could somebody explain exactly how this feature detection is working?</p>

<pre><code>// Create a dummy element for feature detection
if (!('placeholder' in $('&lt;input&gt;')[0])) {
</code></pre>

<p>This line of code detects whether or not the browser supports the placeholder attribute on input elements.</p>

<p>I'd like to be a bit more comfortable with what is going on under the hood here before deploying to production.</p>

<p>Will this end up cycling through all possible attributes of the input element, just to check for the existence of a <code>placeholder</code> element? If this is the case, I was not aware that we get access (in some fashion) to elements that aren't spelled out explicitly in the markup.</p>

<p><a href="http://www.jacklmoore.com/notes/form-placeholder-text" rel="nofollow">Code Source</a></p>
