我有一个功能:
<script>
function params(a,b,c,d) {
// alert (c);
var question = document.getElementById("question");
question.value = c;
var answer = document.getElementById("answer");
answer.value = d;
var catid = document.getElementById("catid");
catid.value = a;
var qid = document.getElementById("qid");
qid.value = b;
}
<button class="modalInput" rel="#prompt" onClick="params(29,29,'In a FOX TV show, what did 'The OC' stand for','Orange County');"><img src=/images/exclamationmark1.png title="Is there an error in this question, report it here." ></button>
<button class="modalInput" rel="#prompt" onClick="params(29,16,'Which reality show is named after a George Orwell character','Big Brother');"><img src=/images/exclamationmark1.png title="Is there an error in this question, report it here." ></button>
第一个按钮不起作用,因为 #&039; - 第二个确实...但是第一个确实来自在字符串上使用 htmlspecialchars()... 所以我认为这会成功吗?
你可以在这里看到它的页面: