Hello 최근에 나는 HTML 작업을 시작했는데, iam은 HTML 페이지 하나에서 다음 html 페이지로 값을 보내고 싶은 상황에서 우리의 이름은 후하나의 HTML 페이지에서 다른 페이지로 javascript 변수 전달하기
pageOne.html
<!DOCTYPE html>
<head>
<title>
Home
</title>
<meta charset="UTF-8">
</head>
<style>
.myP{
color: lightgreen;}
</style>
<body>
<p id="p1" class="myP" onclick="myFun()">DataSend</p>
</body>
<script>
function myFun(){
document.getElementById("p1").style.color = "blue";
var textprevi=document.getElementById("p1").innerHTML;
localStorage.setItem("message", textprevi);
window.open("pageTwo.html","_self");
}
</script>
</html>
, 내가 두 HTML 페이지를 작성했습니다 success.Here을 가입하고 내 두 번째
제가 상기 용액, ID = " TBOX"인 요소를 시도 할 때 16,pageTwo.html
<!DOCTYPE html>
<html>
<body onload="fun">
<input type="text" id="tBox">
</body>
<script>
function fun()
{
document.getElementById("tBox").innerHTML = localStorage.getItem("message");
}
</script>
</html>
하지만 비어 있지만 그것이 내지 값 = "DataSend"채워질 싶었 pageOne.html. 제발 도와주세요. 미리 감사드립니다.