iT邦幫忙

0

想要切換完以後,又可以切換回去要怎麼設定?

各位大大大神安安
假如:
只是要做單純的切換(html固定不變)
先設定id,
再用document.getElementById
然後.addEventListener("click", myfunction);
在設定function myfunction()
就可以做切換
ex: Name => Derek

但是,如果我想要切換完以後,又可以切換回去要怎麼設定?

(1.html 不做改變
2.也沒有button)

https://ithelp.ithome.com.tw/upload/images/20210708/20138659yV9ZFm5Sa3.jpghttps://ithelp.ithome.com.tw/upload/images/20210708/20138659BDlHtkerTn.jpghttps://ithelp.ithome.com.tw/upload/images/20210708/20138659DzvnFxMnni.jpghttps://ithelp.ithome.com.tw/upload/images/20210708/20138659gzydqq0x7u.jpg

圖片
  直播研討會
圖片
{{ item.channelVendor }} {{ item.webinarstarted }} |
{{ formatDate(item.duration) }}
直播中

1 個回答

1
海綿寶寶
iT邦大神 1 級 ‧ 2021-07-08 18:10:12

https://ithelp.ithome.com.tw/upload/images/20210708/20001787MJan5mwX2L.png

XDD 簡單明瞭

我要發表回答

立即登入回答