ユーザーがテキスト領域に入力した内容をタグにコピーしたいのです<p>が、うまくいきません。ユーザーが保存ボタンをクリックすると、テキストが<p>タグに表示されます。
これが私のコードです:
<div>
<div>
<h2>You are to write your tought here in this test box and click save</h2>
<label for="heiku" class="label">Your Heiku</label>
<br />
<textarea class="textarea" id="heiku" name="heiku" rows="4" cols="50">
Write your Heiku here
</textarea>
<button class="button" id="submit" Onclick="Save()">Save</button>
<p class="p" id="heiki_input"></p>
</div>
</div>
<script>
let heiku = document.getElementById("heiku").value;
let heiku_input = heiku
function save(){
document.getElementById("heiku_input").innerText = heiku_input;
console.log(heiku_input);
}
</script>