I wrote a jquery code to trigger an alart on click of radiobutton (My credits/ Company credits/ Customer pay). I got the code to work perfectly in codepen and the console, but when I past in Webflow page body, it doesn’t work. Can anyone help check this out?
Here is the code:
$(document).ready(function () {
$(‘input[name=“Triggarr”]’).change(function () {
var mc = document.getElementById(‘my-credit’)
var cc = document.getElementById(‘company-credit’)
var cp = document.getElementById(‘customer-pay’)
var rad1 = document.getElementById('radio1')
var rad2 = document.getElementById('radio2')
var rad3 = document.getElementById('radio3')
if(rad1.checked) {
alert(“UK is checked”);
}
else if(rad2.checked) {
alert('Europe is checked');
}
else if(rad3.checked) {
alert('Nigeria is checked');
}
});
});
page: Test
codepen: https://codepen.io/BaaWA1/pen/jOpdRJP
Loom video: Loom | Free Screen & Video Recording Software | Loom