mirror of
https://github.com/ianramzy/decentralized-video-chat.git
synced 2024-11-15 06:39:20 +08:00
23 lines
701 B
JavaScript
23 lines
701 B
JavaScript
|
;(function () {
|
||
|
'use strict'
|
||
|
const pricingToggle = document.getElementById('pricing-toggle')
|
||
|
|
||
|
if (pricingToggle) {
|
||
|
window.addEventListener('load', pricingSwitch)
|
||
|
pricingToggle.addEventListener('change', pricingSwitch)
|
||
|
}
|
||
|
|
||
|
function pricingSwitch () {
|
||
|
const switchables = document.getElementsByClassName('pricing-switchable')
|
||
|
if (pricingToggle.checked) {
|
||
|
for (let i = 0; i < switchables.length; i++) {
|
||
|
switchables[i].innerHTML = switchables[i].getAttribute('data-pricing-yearly')
|
||
|
}
|
||
|
} else {
|
||
|
for (let i = 0; i < switchables.length; i++) {
|
||
|
switchables[i].innerHTML = switchables[i].getAttribute('data-pricing-monthly')
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
}())
|