Created
July 23, 2015 05:01
-
-
Save JavaScript-Packer/dbda82aae980f0e5b121 to your computer and use it in GitHub Desktop.
Better alternative for document.write() in JavaScript using createElement div document.body.appendChild
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <!DOCTYPE html> | |
| <html> | |
| <head> | |
| </head> | |
| <body> | |
| <script> | |
| var div = document.createElement("div"); | |
| div.innerHTML = '<a href="http://www.whak.ca">www.WHAK.ca</a>'; | |
| document.body.appendChild(div); | |
| </script> | |
| </body> | |
| </html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment