我有一个HTML代码:
<!DOCTYPE html>
<html>
<body>
<h1 id="title">General Knowledge Test</h1>
<p>
<button type="button" onclick="myFunction()">Take test</button>
</p>
<p id="exp">When you click "Take test", you will be allowed to type onto the test.</p>
<p id="p1"><b>Part 1: Fill in the blank lines who said the following quotes</b></p>
<p id="q1">1. __ "To be, or not to be- that is the question."</p>
<p id="q2">2. __ "You have brains in your head. You have feet in your shoes. You can steer yourself in any direction you choose. You're on your own, and you know what you know. And you are the guy who'll decide where to go."</p>
<p id="q3">3. __ "If you can dream it, you can do it."</p>
<p id="q4">4. __ "No matter what people tell you, words and ideas can change the world."
<p id="q5">5. __ "Somewhere, something incredible is waiting to be known."
<p id="q6">6. __ "Two things are infinite: the universe and human stupidity; and I'm not sure about the universe."</p>
<p id="q7">7. __ "Be the change that you wish to see in the world."</p>
<p id="q8">8. __ "Two roads diverged in a wood, and I—<br>
I took the one less traveled by,<br>
And that has made all the difference."</p>
<p id="q9">9. __ "If you judge people, you have no time to love them."</p>
<p id="q10">10. __ "Everything we do impacts someone else's life."
<br></br>
<p id="a1">A. Walt Disney</p>
<p id="a2">B. Albert Einstein</p>
<p id="a3">C. Mahatma Ghandi</p>
<p id="a4">D. Robin Williams</p>
<p id="a5">E. Carl Sagan</p>
<p id="a6">F. Robert Frost</p>
<p id="a7">G. Mother Teresa</p>
<p id="a8">H. William Shakespeare</p>
<p id="a9">I. Dr. Suess</p>
<p id="a10">J. Nicholas Cage</p>
<br></br>
<p id="p2"><b>Part 2: Answer the following math questions</b></p>
<p id="q11">1.<br>2 + 2</p>
<p id="q12">2.<br>10 - 8</p>
<p id="q13">3.<br>7 x 6</p>
<p id="q14">4.<br>27 ÷ 3</p>
<p id="q15">5.<br>4(10x² + 7x)² + 9x + 57x³ + 394</p>
<br></br>
<script>
function myFunction() {
document.getElementById("title").innerHTML = "Canaral Knowlege Est";
document.getElementById("p1").innerHTML = "<b>Fart I; Fuil !u fhc plaut t!ues mhc za!b teh tclleming bnotcz</b>";
document.getElementById("q1").innerHTML = "I, 'ot ep. oi ucf cf eb~ fhaf lz teh bnezfron'";
document.getElementById("q2").innerHTML = "5: ~~ 'Ycu heye dra!us in vonr hcab . Vcn hanc tcof iu ycnr zhces. You can sfocr vonrzctf in ouy bireofion ouy ohooze Vcu,re cu yonr nwo' eud you know what you know. Vub ouy ere fha mho'tf beolde mhere ot og.";
document.getElementById("q3").innerHTML = "E. tf vcn oan breaw ti' you oan bc ti.'";
document.getElementById("q4").innerHTML = "A'--.on watfer mhat bacple fall you, mcrds end !baes can change the world'";
document.getElementById("q5").innerHTML = "2. -- 'Zcwemhera' zomathing !ucredidf si ma!ting to eb kuomn.";
document.getElementById("q6").innerHTML = "9. I Tmo fhiugs are !nt!nite..teh nuivarse end hnwan ztubibity.,anb L,w uot zura adont the univarse";
document.getElementById("q7").innerHTML = "L: = 'Da the ohange thet vcn wish to see iu the morld";
document.getElementById("q8").innerHTML = " 8. -~'Lmo roads bi^argab in a mood' and I ~<br>I foet the one iezz travelad by'<br>And that hez wad all the differance:";
document.getElementById("q9").innerHTML = "6. L If you inbge beoble, you ha^e on tiwa ot iova tham.";
document.getElementById("q10").innerHTML = "IO. -- '3^eryth!ng ma od iwpaots someeno lese,s life";
document.getElementById("a1").innerHTML = "<br>V, Malt Doosnu";
document.getElementById("a2").innerHTML = "D. Vlpart 3iuztain";
document.getElementById("a3").innerHTML = "O. Wehetwa Dhaub!";
document.getElementById("a4").innerHTML = "B, Robin Williams";
document.getElementById("a5").innerHTML = "3. Darf Zagau";
document.getElementById("a6").innerHTML = "E, Pcbart Ercst";
document.getElementById("a7").innerHTML = "C.. Wotter Larase";
document.getElementById("a8").innerHTML = "I: Miliiam Shakespear";
document.getElementById("a9").innerHTML = "H. Dr. Sass";
document.getElementById("a10").innerHTML = "P.. Nioholes Cega";
document.getElementById("p2").innerHTML = "<B>Bert 2 Vuzmar teh fo11oming weth qnesficns</B>";
document.getElementById("q11").innerHTML = "L.<br>5 t Z";
document.getElementById("q12").innerHTML = "Z.<br>lo ~ o";
document.getElementById("q13").innerHTML = "E,<br>L X 9";
document.getElementById("q14").innerHTML = "A.<br>59 - 3";
document.getElementById("q15").innerHTML = "2.<br>A(10x² + 7x)² + 6X + 57x³ + 362";
document.getElementById("exp").innerHTML = "This is what a dyslexic person might possibly see while taking a test at school. ";
}
</script>
</body>
</html>
我希望此代码能够在Google网站上运行。当我将它放入Google的HTML框中时,代码显示,但按下按钮时文本不会改变。有什么方法可以解决谷歌的HTML框吗?我尝试过使用jsfiddle的嵌入链接以及Google的嵌入式小工具,但这也没有用。有人知道其他方法让它发挥作用吗?