Difference between revisions of "Input with changing name"

From Level Access Web Labs
Jump to navigation Jump to search
(Created page with "<html> <script> var val = 1; function test() { document.getElementById("lbltest").textContent = toString(val+1); } </script> <label for="time" id="lbltime">Time</label> <input...")
 
 
Line 3: Line 3:
 
var val = 1;
 
var val = 1;
 
function test() {
 
function test() {
document.getElementById("lbltest").textContent = toString(val+1);
+
  val = val + 1; 
 +
document.getElementById("lbltime").textContent = val.toString();
 
}
 
}
 
</script>
 
</script>
 
<label for="time" id="lbltime">Time</label>
 
<label for="time" id="lbltime">Time</label>
<input id="time" type="text" onchange="test();">
+
<input id="time" type="text" onkeypress="test();">
 
</html>
 
</html>

Latest revision as of 18:00, 15 August 2022