function set_selected(element, selected) {
	if (selected) {
		// The selected option could've changed via user selection, and
		// setting the value without this check would set it back.
		if (!element.hasAttribute('selected')) {
			element.setAttribute('selected', '');
		}
	} else {
		element.removeAttribute('selected');
	}
}
Sets the `selected` attribute on an `option` element.
Not set through the property because that doesn't reflect to the DOM,
which means it wouldn't be taken into account when a form is reset.
@param {HTMLOptionElement} element
@param {boolean} selected