+ 1
Why need JavaScript to write a paragraph or remove elements, attributes, etc?
In few SL lessons, I saw this case where JS is used to write paragraph & remove or add elements, attributes. What is the main purpose of this? Because I know if I want to remove or add anything like this, I can do it directly in the HTML tags
3 RĂ©ponses
+ 6
For example, you have a website.
You have a button that adds or removes a paragraph in an article when clicked.
Now, when thousands of users accessed your website all at the same time and clicked that button, can you add or remove that paragraph manually in HTML tags for each request?
There comes JavaScript. It can do it dynamically with optimal reliability and speed under normal circumstances.
+ 2
Thanks guys! I'm grateful for thisđđ
+ 1
You can edit static contents by modifying HTML tags, but not dynamic ones.
Not really HTML based, we can still use SoloLearn as an example.
For every question you asked, the app will also display duetime and your username. At the time of writing code, it is not possible to know the how many question will be created, at which time, by whom. This is generated on runtime, which requires JS to do so.