0
我想將以下代碼添加到Wordpress,但是,每當我嘗試更新時,wordpress總會給我提供錯誤404。我是編碼新手。所以會感謝一些幫助。如何在wordpress中啓用按鈕onClick函數和java腳本
<!DOCTYPE html>
<!--
To change this license header, choose License Headers in Project Properties.
To change this template file, choose Tools | Templates
and open the template in the editor.
-->
<html>
<head>
<meta charset="UTF-8">
<title></title>
</head>
</head>
<body>
Code 1: <input type="text" id="code1">
<br>
<p id="code1ans"></p>
Code 2: <input type="text" id="code2">
<br>
<p id="code2ans"></p>
Code 3: <input type="text" id="code3">
<br>
<p id="code3ans"></p>
Code 4: <input type="text" id="code4">
<br>
<p id="code4ans"></p>
<button onclick="myFunction()">Submit</button>
<script>
function myFunction() {
var code1 = document.getElementById("code1").value;
var code2 = document.getElementById("code2").value;
var code3 = document.getElementById("code3").value;
var code4 = document.getElementById("code4").value;
document.getElementById("code1ans").innerHTML = code1;
document.getElementById("code2ans").innerHTML = code2;
document.getElementById("code3ans").innerHTML = code3;
document.getElementById("code4ans").innerHTML = code4;
}
</script>
</body>
</html>
目前尚不清楚你試圖達到什麼目標。你的意思是沒有你添加的代碼你沒有404,但通過在