简体   繁体   English

如何使用 JavaScript 或 JQuery 更改 html 内容?

[英]How to change html content using JavaScript or JQuery?

How to change html content using JavaScript or JQuery?如何使用 JavaScript 或 JQuery 更改 html 内容?

在此处输入图片说明

I want to change contents from 1 to 5 sequentially according to the time as stated in the picture.我想根据图片所示的时间顺序将内容从 1 更改为 5。 What should I do using JavaScript or JQuery?我应该使用 JavaScript 或 JQuery 做什么? Please let me know if you have any search keywords or links to related documents.如果您有任何搜索关键字或相关文档的链接,请告诉我。

As per the picture, I assume that you want to randomly shuffle the contents each day.根据图片,我假设您想每天随机洗牌内容。 you can do this by using an array of contents and on each day randomly select an element from the array and set it as the content of div using DOM manipulation.您可以通过使用内容数组来做到这一点,每天从数组中随机选择一个元素,并使用 DOM 操作将其设置为 div 的内容。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM