I have a simple JS animation script that fetches data from the
<div class="quiz"> Some content </div>
for animation. When I include this script in my HTML, the animation and other functions such as previous and next work properly. See an example below:
// Your JavaScript animation code
#rect {
font-weight: 900;
font-size: 2.5em;
}
#rect .letter {
line-height: 1em;
}
#quizss {
display:none;
}
.word {
white-space: nowrap;
}
<div class="quiz">Question-1 : The color of the sky is...?</div>
<div class="quiz">Question-2 : Paper comes from...?</div>
<div class="quiz">Question-3 : How many hours in a day?</div>
<div class="quiz">Question-4 : A Giraffe is a fish?</div>
<div id="rect"></div>
<br>
<Button id="rc" onclick="previous()">previous</Button>
<Button id="rc" onclick="next()">Next</Button>
<br>
If you want to dynamically create divs based on multiline text input using a text box, it may not work with the existing JavaScript animation function. You can check this by adding lines through the text box.
The code for your text box is as follows:
// Your JavaScript code for creating dynamic divs
<div id="rect"> </div>
<textarea class="input" id="input" placeholder="Message..."></textarea>
<button class="waves-effect waves-light" id="send-btn">Send</button>
If you're looking to integrate the text box data into the existing JavaScript animation, you might need to modify the animation script accordingly. Here's a snippet combining both scripts:
// Combined JS animation and textarea script
// Your combined script goes here
<style>
#rect {
font-weight: 900;
font-size: 1.5em;
font-family: rr;
}
#rect .letter {
line-height: 1em;
}
#quizss {
display:none;
}
.word {
white-space: nowrap;
}
</style>
// Include necessary scripts
<div class="quiz">Question-1 : The color of the sky is...?</div>
<div class="quiz">Question-2 : Paper comes from...?</div>
<div class="quiz">Question-3 : How many hours in a day?</div>
<div class="quiz">Question-4 : A Giraffe is a fish?</div>
<div id="rect"></div>
<br><br>
<textarea class="input" id="input" placeholder="Message..."></textarea>
<button class="waves-effect waves-light" id="send-btn">Send</button>
<br><br>
<Button id="rc" onclick="previous()">Previous</Button>
<Button id="rc" onclick="next()">Next</Button>