added new options in select

This commit is contained in:
MaxOvs19
2023-10-04 18:26:51 +03:00
parent 49478b316c
commit d5bbec2b7f
8 changed files with 76 additions and 10 deletions

View File

@@ -5,10 +5,14 @@ import { ICreateBreadCrumb } from './create-element.interface';
* The method that creates the native select.
* @returns {HTMLSelectElement} Returns the created native select.
*/
export function createNativeSelect(): HTMLSelectElement {
export function createNativeSelect(nameSelect: string | undefined): HTMLSelectElement {
const nativeSelect = document.createElement('select');
nativeSelect.setAttribute('name', 'dataSelect');
if (nameSelect == undefined) {
nativeSelect.setAttribute('name', 'CgSelect');
} else {
nativeSelect.setAttribute('name', nameSelect!);
}
nativeSelect.classList.add('nativeSelect');
return nativeSelect;
}