Design3 min read
Have a radio button selected by default in Webflow

Introduction
| Step | Action |
|---|---|
| 1 | Add your radio buttons to the Webflow form |
| 2 | Add a value to each radio button |
| 3 | Get the ID of the radio button you want selected by default |
| 4 | Add the script to the page head |
Not possible natively in Webflow, Sandro, cofounder of the Gemeos Webflow agency, shows you how to have a radio button selected by default in your form when the page loads in Webflow.
Super useful for improving the user experience in some cases, especially for feedback forms, for example.
1. Add your radio buttons

2. Add a value to your radio buttons

3. Add this script to the <head> of your page
Make sure you replace the ID value with the value of the radio button you want selected by default in the code below.
<script>
window.onload = function() {
var radioButton = document.getElementById("incroyable");
if (radioButton) {
radioButton.checked = true;
}
};
</script>4. Publish and test the result



