/
coreInputDemo.html
30 lines (30 loc) · 982 Bytes
/
coreInputDemo.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
<!DOCTYPE html>
<html>
<head lang="en">
<meta charset="UTF-8">
<title>Core Input Demo</title>
<script src="bower_components/webcomponentsjs/webcomponents.min.js">
</script>
<link rel="import" href="bower_components/polymer/polymer.html">
<link rel="import" href="bower_components/core-input/core-input.html">
</head>
<body>
<section>
<input is="core-input" id="coreInput1"
type="number"
placeholder="Enter a Number"
preventInvalidInput
onchange="changeHandler()">
</section>
<script>
var changeHandler = function(){
var coreInput1 = document.getElementById("coreInput1");
console.log("Value "+coreInput1.value);
console.log("Before commit committedValue "+coreInput1.committedValue);
//Committing the value
coreInput1.commit();
console.log("After Commit committedValue "+coreInput1.committedValue);
}
</script>
</body>
</html>