I am currently working on a product customization form where the radio buttons are hidden using opacity:0.
My goal is to have the border of the image turn black when an option is selected as a visual feedback for the user. I've implemented an event listener on the radio button so that when it's focused, it changes the parent div's CSS properties to provide feedback to the user.
While this setup works perfectly in Chrome and on jsfiddle, it doesn't seem to work on mobile or Safari browsers.
What could be causing this issue and what could be a suitable workaround?
You can view the code on jsfiddle here: https://jsfiddle.net/gLwjhqtd/
$('.radioButtons')
.focus(function() {
$(this).parent().css('border','2px solid black');
})
.blur(function() {
$(this).parent().css('border','none');
})
Thank you!