Probleme javascript
f
-
Romain -
Romain -
bonjour j'ai un gros probleme j'ai besoin d'un programme pour mes révision d'informatique et je n'arrive pas a trouver pk il ne marche pas pourriez vous m'aider?
voicileprogramme:
<html>
<head>
<script>
function isVoyelle(l) {
return (l=='a' || l=='e'|| l=='e'|| l=='i'|| l=='u'|| l=='y') ;
}
function switchToA(text) {
old_text = text.value ;
new_text = '' ;
for (i=0;i<old_text.length;i++) {
letter = old_text[i] ;
new_text + = (isVoyelle(l)?'a':letter);
}
text.value=new_text ;
}
</script>
</head>
<body>
<input type="text" id="myText">
<input type="button" onclick="switchToA(document.getElementById('myText'));">
</body>
voicileprogramme:
<html>
<head>
<script>
function isVoyelle(l) {
return (l=='a' || l=='e'|| l=='e'|| l=='i'|| l=='u'|| l=='y') ;
}
function switchToA(text) {
old_text = text.value ;
new_text = '' ;
for (i=0;i<old_text.length;i++) {
letter = old_text[i] ;
new_text + = (isVoyelle(l)?'a':letter);
}
text.value=new_text ;
}
</script>
</head>
<body>
<input type="text" id="myText">
<input type="button" onclick="switchToA(document.getElementById('myText'));">
</body>
A voir également:
- Probleme javascript
- Telecharger javascript - Télécharger - Langages
- A javascript error occurred in the main process - Forum Windows
- Afficher un tableau javascript en html ✓ - Forum Javascript
- Javascript arrondi - Forum Javascript
- Javascript arrondi après la virgule ✓ - Forum Windows
5 réponses
Salut !
Tu pourrais déjà commencer par fermer ta balise <html>, à moins que ce soit une erreur de copier/coller.
Tu pourrais déjà commencer par fermer ta balise <html>, à moins que ce soit une erreur de copier/coller.
c pa un truc tres compliké... quand tu appelle la foncin is voyelle, appelle la avec letter, pas avec l, dans la fonction switchtoa
Vous n’avez pas trouvé la réponse que vous recherchez ?
Posez votre question