JSFiddle - React, Tailwind, and code Playground
by Walter Rumsby
HTML
<script src="http://yui.yahooapis.com/3.3.0/build/yui/yui-min.js"></script>
<!DOCTYPE html>
<html>
<head>
<title>Placeholder Test</title>
</head>
<body>
<form>
<input id="field" name="field" type="text" placeholder="Enter some text" value=""/>
<input name="field-2" type="text" placeholder="Enter more text" value=""/>
</form>
<p>
<a href="#" id="link">Focus field</a>
</p>
</body>
</html>
CSS
input {
display: block;
}
JavaScript
YUI().use('node', 'event', function(Y) {
Y.one('#link').on('click', function(e) {
Y.one('#field').focus();
e.preventDefault();
});
});