Built with blockbuilder.org
xxxxxxxxxx
<head>
<meta charset="utf-8">
<script src="https://d3js.org/d3.v4.min.js"></script>
<style>
body { margin:0;position:fixed;top:0;right:0;bottom:0;left:0; }
</style>
</head>
<body>
<form><input id="hora_atual"></form>
<script>
// Feel free to change or delete any of the code you see in this editor!
var svg = d3.select("body").append("svg")
.attr("width", 960)
.attr("height", 500)
svg.append("text")
.text("uma")
.attr("id", "uma")
.attr("y", 100)
.attr("x", 120)
.attr("font-size", 36)
.attr("font-family", "monospace")
svg.append("text")
.text("duas")
.attr("id", "duas")
.attr("y", 100)
.attr("x", 240)
.attr("font-size", 36)
.style("display", true)
.attr("font-family", "monospace")
d3.select("#hora_atual").on("input", function() {
//console.log(+this.value);
update(+ this.value);
});
function update(hora) {
d3.selectAll("text").style("visibility", "hidden");
if (hora == 1) {
console.log(hora==1);
d3.select("#uma").style("visibility", "visible");
} else if (hora == 2) {
d3.select("#duas").style("visibility", "visible");
}
}
</script>
</body>
https://d3js.org/d3.v4.min.js