我有一个树枝变量:
{% set emailmult1= 'op000' %}
和我js功能:
<script type="text/javascript">
function seleccionartod(emailmult1, estado) {
for (var i = 0; i < 1; i ++)
document["forms"]["emailmultiple"]["op000000"]["checked"] = estado;
document["forms"]["emailmultiple"][emailmult1 + i]["checked"] = estado;
}
</script>
这有效:
<input name="checkbox1" type="checkbox" value="Todos" onclick="seleccionartod( 'op000' , this.checked)"/>
但这不起作用:
<input name="checkbox1" type="checkbox" value="Todos" onclick="seleccionartod( {{ emailmult1 }} , this.checked)"/>
由于