在javascript type =“text”中;不在IE 8中工作并且正在使用IE 10 +
以下是代码:
function showAnsers() {
//enter code here
var ans;
if (document.getElementById('displayanswer').checked == true) {
<% for(int i=0; i<sd.getQuestionsCount(); ++i) { %>
var ans1 = document.getElementById("_custom__answers" + <%=i%>).type = "text";
<%}%>
} else if (document.getElementById('displayanswer').checked == false) {
<% for(int i=0; i<sd.getQuestionsCount(); ++i) { %>
var ans1 = document.getElementById("_custom__answers" + <%=i%>).type = "password";
<%}%>
}
};