2016-08-01 15:49:50 +02:00
|
|
|
<!DOCTYPE html>
|
|
|
|
|
|
|
|
<html>
|
|
|
|
<head>
|
|
|
|
<meta charset="utf-8">
|
|
|
|
<title>Simple input</title>
|
2017-03-01 17:11:45 +01:00
|
|
|
<script type="text/javascript">
|
|
|
|
function setup_event_listener() {
|
|
|
|
var elem = document.getElementById('qute-input-existing');
|
|
|
|
console.log(elem);
|
|
|
|
elem.addEventListener('input', function() {
|
|
|
|
console.log("contents: " + elem.value);
|
|
|
|
});
|
|
|
|
}
|
|
|
|
</script>
|
2016-08-01 15:49:50 +02:00
|
|
|
</head>
|
2017-03-01 17:11:45 +01:00
|
|
|
<body onload="setup_event_listener()">
|
2016-08-18 16:13:38 +02:00
|
|
|
<form><input id="qute-input"></input></form>
|
2017-02-03 23:32:20 +01:00
|
|
|
With padding:
|
|
|
|
<form><input type="text" style="padding-left: 20px;"></input></form>
|
2017-03-01 17:11:45 +01:00
|
|
|
With existing text (logs to JS)::
|
|
|
|
<form><input id="qute-input-existing" value="existing"></input></form>
|
2016-08-01 15:49:50 +02:00
|
|
|
</body>
|
|
|
|
</html>
|