Click here to Skip to main content
15,743,609 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
I would like to put this : (im french)
		const facileBtn=document.getElementById("boutonF");
		const moyenBtn=document.getElementById("boutonM");
		const difficileBtn=document.getElementById("boutonD");

		function changeEnFacile(){
			console.log("ca marche")
			document.getElementById("calcul").innerHTML="c'est facile";

		function changeEnMoyen(){
			console.log("ca marche")
			document.getElementById("calcul").innerHTML="c'est moyen";

		function changeEnDifficile(){
			console.log("ca marche")
			document.getElementById("calcul").innerHTML="c'est difficile";


in a Javascript file and then put
<script src="file.js">

What I have tried:

I have to precise that the program works in the HTML "script" tag. But it doesn't work... suggest ?
Updated 8-Mar-23 20:37pm
Richard MacCutchan 8-Mar-23 10:59am    
Firstly that is Javscript, not Java. Secondly, we have no idea what is meant by "it doesn't work". Please use the Improve question link above, and add complete details of what is not working.

1 solution

Hello !

as the script tag is 'duet', for your need :

<script src="file.js"></script>

// you can write it between 'head' tags, or in 'body' tag
Share this answer

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900