You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

94 lines
2.9 KiB
JavaScript

document.addEventListener('DOMContentLoaded', function () {
// Osicloud 1 Subscription
const firstOsicloudPrices = {
1: 89,
3: 200,
6: 350,
12: 650,
24: 1200,
36: 1800,
60: 3000
};
const firstOsicloudSubscriptionOptions = document.querySelectorAll('.firstOsicloudSubscriptionOptions');
firstOsicloudSubscriptionOptions.forEach(function (options) {
options.addEventListener('change', function () {
const selectedValue = parseInt(this.value);
const priceElement = this.closest('.feature').querySelector('.firstOsicloudPrice');
const price = firstOsicloudPrices[selectedValue];
priceElement.textContent = `$${price}`;
});
});
// Osicloud 2 Subscription
const secondOsicloudPrices = {
1: 169,
3: 400,
6: 700,
12: 1300,
24: 2400,
36: 3600,
60: 6000
};
const secondOsicloudSubscriptionOptions = document.querySelectorAll('.secondOsicloudSubscriptionOptions');
secondOsicloudSubscriptionOptions.forEach(function (options) {
options.addEventListener('change', function () {
const selectedValue = parseInt(this.value);
const priceElement = this.closest('.feature').querySelector('.secondOsicloudPrice');
const price = secondOsicloudPrices[selectedValue];
priceElement.textContent = `$${price}`;
});
});
// Osicloud 3 Subscription
const thirdOsicloudPrices = {
1: 89,
3: 200,
6: 350,
12: 650,
24: 1200,
36: 1800,
60: 3000
};
const thirdOsicloudSubscriptionOptions = document.querySelectorAll('.thirdOsicloudSubscriptionOptions');
thirdOsicloudSubscriptionOptions.forEach(function (options) {
options.addEventListener('change', function () {
const selectedValue = parseInt(this.value);
const priceElement = this.closest('.feature').querySelector('.thirdOsicloudPrice');
const price = thirdOsicloudPrices[selectedValue];
priceElement.textContent = `$${price}`;
});
});
// Osicloud 4 Subscription
const fourthOsicloudPrices = {
1: 89,
3: 200,
6: 350,
12: 650,
24: 1200,
36: 1800,
60: 3000
};
const fourthOsicloudSubscriptionOptions = document.querySelectorAll('.fourthOsicloudSubscriptionOptions');
fourthOsicloudSubscriptionOptions.forEach(function (options) {
options.addEventListener('change', function () {
const selectedValue = parseInt(this.value);
const priceElement = this.closest('.feature').querySelector('.fourthOsicloudPrice');
const price = fourthOsicloudPrices[selectedValue];
priceElement.textContent = `$${price}`;
});
});
});