WEBLEB
Accueil
Éditeur
Connexion
Pro
Français
English
Français
Español
Português
Deutsch
Italiano
हिंदी
convertir du texte en voix
1413
kuzma
Ouvrir dans l'éditeur
Publiez votre code
Recommandé
16 September 2025
Modèle HTML de formulaire d'envoi de pièces TikTok
13 April 2024
Bouton bascule HTML CSS
30 August 2024
Animations pilotées par défilement Détection de défilement
HTML
Copy
Text to Speech
Speak
CSS
Copy
<style> body { font-family: Arial, sans-serif; background-color: #f0f0f0; display: flex; justify-content: center; align-items: center; height: 100vh; margin: 0; } div { background-color: #fff; padding: 20px; border-radius: 10px; box-shadow: 0 0 10px rgba(0, 0, 0, 0.1); } input[type="text"] { width: 92%; height: 40px; margin-bottom: 10px; padding: 10px; font-size: 16px; border: 1px solid #ddd; border-radius: 5px; } button { font-weight: 600; width: 100%; height: 25px; font-size: 16px; background-color: #299893; color: #fff; border: none; border-radius: 5px; cursor: pointer; } button:hover { background-color: #299893; } </style>
JS
Copy
<script> function speak(){ var text = document.getElementById("input").value.trim(); if (text !== "") { var utterance = new SpeechSynthesisUtterance(text); speechSynthesis.speak(utterance); } else { alert("Please enter some text"); } } </script>