examples/textInput.html
<!DOCTYPE html>
<html>
<head>
<title>Text Input Example</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel='stylesheet' type='text/css' href='https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css'>
<script src="https://cdn.polyfill.io/v2/polyfill.min.js"></script>
<script src='../dist/ui.js'></script>
</head>
<body>
<div class='ui-text-input-example' style='width: 200px;'></div>
<script>
var c = new UI.TextInput('.ui-text-input-example', {
submitHandler: function () {
console.log('the enter key has been pressed!');
},
placeholder: 'What up?',
icon: 'X'
});
c.subscribe(function (value) {
console.log("the current value is: ", value);
});
c.render();
</script>
</body>
</html>