window.addEventListener('DOMContentLoaded', function() {
// find the "Department" dropdown element
var departmentDropdown = document.querySelector('select[name="input_11"]');
departmentDropdown.value = 'value of option with spaces';
});
The eventListener for DOMContentLoaded is optional, it’s preferable to simply load the JavaScript in the footer.
If you are familiar with Gravity Forms, you will see this is a Gravity Forms class, but as long as you select the dropdown with its class or ID, it should work the same for any dropdown.
Have any questions or comments? Write them below!