-
Fototrend
JavaScript != Java (A JavaScript nem összekeverendő a Javával, két különböző programozási nyelvről van szó!)
Új hozzászólás Aktív témák
-
nevemfel
senior tag
válasz
Chrystall
#9577
üzenetére
Kicsit átalakítottam a scriptet is:
<div id="497489" style="width: 100%; overflow-y: hidden;" class="wcustomhtml">
<div class="gombkeret">
<input id="radio1" type="radio" name="radio" data-href="https://www.paypal.com/cgi-bin/webscr?test=1" checked=""><label for="radio1" class="radio"><strong> Standard Mail:<span class="shippingfee"> £5</span></strong> </label>
<input id="radio2" type="radio" name="radio" data-href="https://www.paypal.com/cgi-bin/webscr?test=2"><label for="radio2" class="radio"> <strong> Registered Mail: <span class="shippingfee"> £9</span></strong> </label>
<input id="radio3" type="radio" name="radio" data-href="https://www.paypal.com/cgi-bin/webscr?test=3"> <label for="radio3" class="radio"><strong> Download Only (.ISO format 4.3GB, playable on Computers, Tablets and Phones with free <a href="https://www.videolan.org">VLC Player</a>)</strong></label>
<div id="address_block"><label for="gmail_address">Your Gmail address:</label> <input type="text" id="gmail_address" name="gmail_address"></div>
</div>
<div id="down_icon2"><a href="https://www.paypal.com/cgi-bin/webscr"><img src="files/theme/paypal.png"></a></div>
<div id="paypalsecure"><img src="files/theme/secure2.png"></div>
<script>
var sliders = document.querySelectorAll(".gombkeret input[type='radio']");
var link = document.querySelector("#down_icon2 a");
var i;
for (i = 0; i < sliders.length; i++) {
sliders[i].addEventListener("change", function() {
var address_block = document.querySelector("#address_block");
link.setAttribute("href", this.getAttribute("data-href"));
if (this.checked && this.getAttribute("id") === "radio3") {
address_block.style.display = "block";
} else {
address_block.style.display = "none";
}
});
}
</script>
</div>
Új hozzászólás Aktív témák
- Ryzen 7 9700x AM5 CPU - garancia 2028.05. hóig
- Philips Evnia 27M2N8500 QD-OLED monitor 1440p 360Hz ALZA garancia
- MacBook Air (2020) M1 processzor, 8GB RAM, 256 GB kiváló állapotban eladó
- Felújított (Refurbished) DELL Latitude 5440 Tartós Üzleti Laptop 14" -40% i5-1345U 10Mag 16/512 FHD
- Xiaomi Poco Pad 256GB blue
Állásajánlatok
Cég: Laptopműhely Bt.
Város: Budapest
Cég: PCMENTOR SZERVIZ KFT.
Város: Budapest

