How to insert HTML from a button click?
I am trying to insert a form when a button is clicked but cannot find a way that does not make me put all of the HTML on one line with back slashes or many ugly lines of code. Something that does not include adding something like jQuery or PHP. How can I make this that is all on one line: <script> function newMsg() { document.getElementById("add_message").innerHTML = "<div class=\"message\">Add Message<br>Title: <input type=\"text\" id=\"title\"><br>Text: <input type=\"text\" id=\"message\"><br><br></div>"; } </script> Look more like this (that has good formatting and is on multiple lines): <s
0 upvotes
View original discussion ↗
Comments
Sign in or sign up to comment and upvote.
No comments yet.