The below query works great when it comes to checking radio buttons and having the "result value" display.
How do I have the "result value" display on page load since the radio buttons already have checked inputs?
jQuery(document).ready(function ($) {
$('input[name*="fed"], input[name*="stake"]').change(function () {
var $this = $(this),
$wrap = $this.closest('.js-weight-calc-wrap'),
fedVal = $wrap.find('input[name*="fed"]:checked').val(),
stakeVal = $wrap.find('input[name*="stake"]:checked').val(),
result = fedVal === 'Very High' ? '3'
: fedVal === 'High' && stakeVal === 'Very High' ? '3'
: fedVal === 'Low to Moderate' && stakeVal !== 'Very High' ? '1'
: '2';
$wrap.find('.js-result').text(result)
});
});