Hey, I am a beginner in JS and don't really understand it. I created this code for a text.
I am trying to copy the text written in the textarea box into bhe blockquote section when you click "POST" button in the section below:Code:<script> function post() { var re = document.GetElementById("text"); document.getElementById('submit').innerHTML="re"; if (re == "" || re == "null"){ alert("Type in a Text"); return false; } else { return true; } } </script> <textarea id="text"></textarea> <button id="post" onclick="post()">Post</button> <blockquote id="submit"></blockquote>
I am also trying to place a false return when the textarea content has a null or no value in the code below:Code:document.getElementById('submit').innerHTML="re";
I need Help with these. I probabally gor the HTML incorrect or JS...Code:if (re == "" || re == "null"){ alert("Type in a Text"); return false; } else { return true; }
Please and thank you.


Reply With Quote

Bookmarks