search function for dropdown svelte

Shared by: devcanvas

javascript

1
function selectOption(event) {
2
	const _selectedOption = event.target.value;
3
	console.log('Selected Option:', _selectedOption);
4
	lang = _selectedOption;
5
	current_data.update((cur) => {
6
		return { ...cur, lang: _selectedOption };
7
	});
8
	console.log($current_data);
9
	// You can do further processing with the selected option here
10
}
11

12
ok greate here
Love it? Share it!

DevCanvas DevCanvas Logo

Online Editor with a collection of awesome frontend code and code snippets for developers of all levels.

Legal & Support

Stand with Palestine 🇵🇸! DO NOT BE SILENCED

© 2025 DevCanvas. All rights reserved.