Built with blockbuilder.org
xxxxxxxxxx
<html>
<head>
<script src="https://d3js.org/d3.v4.min.js"></script>
<script id="latex" type="text/javascript" src="https://latex.codecogs.com/latexit.js"></script>
</head>
<label>Numerator Value: </label><input type="range" min="1" max="100" value="1" step="1" class="slider" id="numeratorVal"><span> ▌▌</span><span> ▶</span><br>
<br>
<h4>Javascript based Latex</h4>
<div id="myequation" lang="latex" style="margin-left:20px">
\frac{1+sin(x)}{y}
</div>
<h4>Img Tag Latex Equation</h4>
<img id="myequationIMG" style="margin-left:20px"src="https://latex.codecogs.com/gif.latex?\frac{1+sin(x)}{y}" border="0"/>
<body>
<script>
d3.select("#numeratorVal").on("change",function(){
var value = d3.select(this).property("value")
var str = "https://latex.codecogs.com/gif.latex?\\frac{" + value + "+sin(x)}{y}"
//d3.select("#myequation").text(str)
d3.select("#myequationIMG").attr("src",str)
})
function reloadJs(src) {
console.log(src)
d3.select("#latex").remove();
d3.select("body").append("script").attr("src",src)
}
</script>
</body>
Modified http://latex.codecogs.com/latexit.js to a secure url
https://d3js.org/d3.v4.min.js
https://latex.codecogs.com/latexit.js