One of the most basic commands in JS: document.write(), used to simply print content onto the page. You can print the content you need word for word - document.write("content"), where content is what needs to be output. content; of course there is another situation where you need to output changes in JS such as variables, etc., then you need to use document.write(variable); of course variable is the variable you want to output.
Since you can output variables, you will definitely want to control the display of variables, such as position and style. The first control method is to add styles inside the application, such as
document.write("=font-size:20px;font-family= Helvetica;"content"" like this, However, if there are too many styles to be added, it will not only appear bloated, but also inconvenient to modify.
In this case, it will definitely feel better to use a selector. Various double quotes and single quotes are used, so when using them, attention should be paid to preventing early matching of double quotes and single quotes. The way I avoid it is to use " to remind the browser not to match prematurely. The example is as follows:
document.write("