i work on program that can make auto report, i want to show a list on html table but i got stuck how to make it work like i want, im using flask as framework here. i have a python code like this:
a = 5
b = 2
result = []
subtraction = a - b
result.append("the value is "+str(subtraction)+" point")
then the result sended to index.html, on my html the code is like this :
<table><tr>
<td>No</td>
<td>description</td>
<td><span id="result"></span></td>
</tr></table>
<script>
var result = '{{result}}';
document.getElementById("result").innerHTML = result;
</script>
i expect to get result value like the value is 3 pointbut i getobject HTML SpanELement, i already check the console.log, i got "the value is 3 point" as resultvalue. how can i make it work the way i want ? sorry if my question is not clear, I will edit again. Thank you in advance
alert({{result}})to see what you get? if it is json consider using JSON.parse({{result}});resultto the template? Flask?