I'm currently using flask to program this code. My problem is I need to make the option value equal to the inner text of the option.
{% for symb in symbol %}
<script src="/static/script.js"></script>
<option id="options" value="0">{{ symb["symbol"] }}</option>
{% endfor %}
This is the code for the /static/script.js
let option = document.querySelector('option').text;
changeContent(option);
function changeContent(option)
{
var opt = document.querySelector('option').options[0];
opt.value = option;
}
If I run the code, the option presents the actual text of {{ symb["symbol"] }}. However, it does copy it to the option value.