JSFiddle - React, Tailwind, and code Playground
by matthewbj
HTML
<script src="http://cds.matthewbjordan.me/src-files/jquery.placeholder.js"></script>
<div id="info"><p>This plugin will only run when native placeholder support is not available.</p></div>
<p> <input type="text" placeholder="This"> </p>
<p> <input type="text" placeholder="That"> </p>
<p> <textarea placeholder="and the Other" rows="7" cols="35"></textarea> </p>
CSS
p { padding:8px }
input, textarea { font-size:1.1em }
JavaScript
var phtest = document.createElement('input'),
str;
if ('placeholder' in phtest) {
str = 'is';
} else {
str = 'is not';
}
$('#info').append('<p style="color:#000080">Native Pleaceholder support ' + str + ' available</p>');
try {
$('input, textarea').placeHolder();// Run the code
} catch (e) {
$('body').append(e.message);
}