<div class="row" align="center">
<input type="hidden" name="index" id="index" value="0">
<div class="tag">
<div class="tag with-color">
<div>
<label id="label"></label>
</div>
</div>
<div>
<input type="submit" name="next" class="btn btn-primary" value="NEXT" onclick="nextValue()"/>
</div>
</div>
</div>
<script type="text/javascript">
function getValue() {
var index = document.getElementById("index").value;
return "${wordList[index+1].word}";
}
function nextValue() {
document.getElementById("label").innerHTML = getValue();
}
window.onload = function(){
document.getElementById("label").innerHTML = "${wordList[0].word}";
}
我有一个按钮,当我点击按钮时我想显示列表模型的属性。 但我不能使用“$ {wordList [index] .word}”。我该如何解决?