0
How to make paragraphs appear per click one after the other?
I am working on the interactive fiction game which consists of multiple paragraphs one after the other...I want each paragraph to be visible with a click. I know that the code is:-(CSS) .p{ visibility:none;} and then by using script to modify none to block on click but this gets applied for all the paragraphs. how to make the para appear per click one after the other?
7 Answers
+ 2
JS can get a list of all paragraphs with getElementByTag and modify them one at a time setting it to be displayed.
+ 3
We rarely use visibility, most time use display to control add/remove element div
+ 1
Let's take a lot of your code...
+ 1
Actually, it could be completely JS. You can add any HTML tags in JS. I add table rows in this program.
https://code.sololearn.com/W0SpGiJ3Vfzb/?ref=app
+ 1
I'm a newbie and am actually using twine 2 for that interactive fiction game so a bit confused with the script side. Thanks Sir!!
+ 1
If you wish some help understanding the code, put some in a code in your account. Link it here and I will explain what is going on via comment on it.
0
finally I found out the problem ,đš
I was using visibility instead of display and then another error was gelelementsbyid instead of getelementbyid...
Here is the format I have built:-
https://code.sololearn.com/WRIury3u3sm2/?ref=app