diff --git a/index.html b/index.html
index 9ddc304..8d90e5a 100644
--- a/index.html
+++ b/index.html
@@ -4,7 +4,7 @@
-SSF (Spreadsheet Format) Live Demo
+SSF (Spreadsheet Number Format) Live Demo
Github Repo
Issues? Something look weird? Click here and report an issue
@@ -20,11 +20,19 @@
var N = document.getElementById('num');
var T = document.getElementById('txt');
function update() {
- try { N.innerText = SSF.format(F.value, Number(V.value)); } catch(e) { N.innerText = e; }
- try { T.innerText = SSF.format(F.value, V.value); } catch(e) { T.innerText = e; }
+ try { N.innerHTML = SSF.format(F.value, Number(V.value)); } catch(e) { N.innerHTML = e; }
+ try { T.innerHTML = SSF.format(F.value, V.value); } catch(e) { T.innerHTML = e; }
+ }
+ if(F.addEventListener) {
+ F.addEventListener('keyup', update);
+ V.addEventListener('keyup', update);
+ } else if(F.attachEvent) {
+ F.attachEvent('onkeyup', update);
+ V.attachEvent('onkeyup', update);
+ } else {
+ F.oninput = update;
+ V.oninput = update;
}
- F.oninput = update;
- V.oninput = update;
update();