<h2>CatPhotoApp</h2>
<p>Kitty ipsum dolor sit amet, shed everywhere shed everywhere stretching attack your ankles chase the red dot, hairball run catnip eat the grass sniff.</p>
<p> Purr jump eat the grass rip the couch scratched sunbathe, shed everywhere rip the couch sleep in the sink fluffy fur catnip scratched.</p>
main
Your browser information:
User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/69.0.3497.100 Safari/537.36.
It looks so cool to see something coded in chinese, I am learning Japanese so I can actually understand some of the hanzis like the one of the father and the child.
In Chinese, those characters can also be used to mean parent and child elements in tree structures like HTML documents.
I should note that those are just placeholders for use in my explanation — they won’t work in an HTML document, at least not “out-of-the-box”… Curiously, #1 below fails to create the desired element in Chrome, but #2 succeeds. I’m guessing this is due to subtleties of the HTML and/or JavaScript specs, but I’ve yet to find the exact reasons.
// #1 (fails)
parentDiv.innerHTML = '<文></文>';
// #2 (succeeds)
const 文 = document.createElement('文'); //yes, this can also be the name of a variable in JavaScript!
parentDiv.appendChild(文);