Posts

combination of document.write() and button in javascript #6

avatar of @razaoktafian
25
@razaoktafian
·
0 views
·
2 min read

hi everyone, on this occasion I will give another javascript tutorial where in this article I will discuss the combination of "document.write" by adding a button in it so when we run the script and press the button it will load what we created inside it. without waiting any longer I will give an explanation of the script below.

like the previous article, so here I do not discuss this source code anymore but I will also include a photo of the source code so that it is more complete in the explanation for the next source code, so for those who do not understand this source code, you can immediately see my article the previous one yes.

in this source code we will create a combination of "document.write" by adding a button in it, you can see in the picture above, first we input the "button" call, then we enter the "click" element again, then we add "document.write" in "document.write" you are free to enter summation numbers or words in it so that when run the results appear. and don't forget to also enter text in the button so that the source code that we make is more perfect.

and this is the result of the source code that I made when it was run, there was no error at run time and the result was like the picture above.

in this picture is the result of the load from the button that we created earlier and only displays the results, and other html documents will disappear only displaying the results of the "document.write" load only.


Hopefully with the article I made about introducing javascript you can understand and you can do it yourself. to be able to understand the javascript logic in the script, you also have to understand it, you don't just memorize the script part, but you have to understand it while memorizing the logic of the javascript elements or attributes.

Hopefully this article can be useful for you, see you again in the next javascript article.