Hi I'm working on a personal website and trying to make a comment box. its still very basic but I have a button that calls a function which stores the values of the name of the person and the comment itself, and then hopefully output it somewhere (I don't care where yet, just want to see an output)
this is a snippet of what I got so far but its not doing anything, and I don't know what I'm doing either ;) so please rescue me
<section class="body_right_comment_input">
<p> Name: </p>
<input type="text" id="name_input"/> </br>
<p> Comment:</p>
<textarea id="comment_input"></textarea>
<button onclick="myFunction()">Click me</button>
</section>
<script type="text/javascript">
function myFunction() {
var commentName = document.getElementById("name_input").value;
var commentValue= document.getElementById("comment_input").value;
document.write(commentName)
document.write(commentValue)
}
</script>