Pre-selecting radio button based on database

Pre-selecting radio button based on database

I'm trying to find the code to pre-select a radio button based on the contact record. For example, we have a list of Major League Baseball playoff contenders and want to display a radio button list of National League playoff contenders:

Los Angeles Dodgers
St. Louis Cardinals
Atlanta Braves

I've mapped a variable to the database, called natLeagueFave. How can I set it up so that it selects the radio button?

  1. var natLeagueFave = <span class=dbrecord >Favorite Team</span>
Form 
  1. <input type="radio" class="custom-control-input" id="Dodgers" name="natLeagueFave " value="Dodgers">
  2. <input type="radio" class="custom-control-input" id="Cardinals" name="natLeagueFave " value="Cardinals">
  3. <input type="radio" class="custom-control-input" id="Braves" name="natLeagueFave " value="Braves">