User:Gokul20042005/xys.js

// Define language-specific data var languageData = { 'en': 'Welcome!', 'te': 'స్వాగతం!', 'hi': 'स्वागत हैं!', 'kn': 'ಸ್ವಾಗತ!', 'mr': 'स्वागत आहे!', 'ml': 'സ്വാഗതം!', 'ta': 'வரவேற்கிறோம்!' };

function changeLanguage { // Get the selected language code from the dropdown var selectedLanguage = document.getElementById('languageSelect').value;

// Update the displayed selected language document.getElementById('selectedLanguage').textContent = 'Selected Language: ' + selectedLanguage;

// Update the displayed greeting based on the selected language document.getElementById('greeting').textContent = 'Greeting: ' + languageData[selectedLanguage]; }

function speakGreeting { // Get the greeting text var greetingText = document.getElementById('greeting').textContent;

// Create a new SpeechSynthesisUtterance instance var speech = new SpeechSynthesisUtterance(greetingText);

// Use the SpeechSynthesis API to speak the greeting window.speechSynthesis.speak(sp