You can add to $.support
quite easily by inserting this at the top of the Javascript you've written:
jQuery.support.placeholder = (function(){
var i = document.createElement('input');
return 'placeholder' in i;
})();
You can then use either $.support.placeholder
or jQuery.support.placeholder
anywhere in your code.
NB This code adapted from diveintohtml5, the link provided by hellvinz above.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…