简体   繁体   中英

How to show my javascript counter result in 2 divs on the same page?

I have a javascript counter (named clock because it counts seconds) where the results are displayed in a div:

<div id="right">Time: <input id="clock" type="text" value="00:00" style="text-align: left; background:transparent; border-style: none; color:#ffbe5e; margin: 0px; font: 20px shanghai; width:60px;" readonly /></div>

This all works and it's displays counting the seconds. Now I want the same display results shown in a sec div at the same page, but how to do this? Simply copy and paste the code again doesn't work.

Any suggestions?

Kind regards,

ps I didn't post the javascript code cause it's a bit too big to copy/paste it in here. If you need it, let me know

如上文dgvid所建议,请确保您拥有的每个计数器都有单独的ID。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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