This is a simple practical but I'm not sure what I'm doing wrong.
I have the following code in my external javascript file:
function myname(){
document.write("Monique");
}
function welcomeW(name){
document.write("Welcome " + name + "!");
}
function welcomeR(name){
return "Welcome " name "!";
}
I added this <script>
tag to link to my html file:
<script src="script.js" type="text/javascript"></script>
I tried calling the functions in html using:
<script> myname(); </script>
<script> welcomeW(Monique); </script>
<script> welcomeR(Monique); </script>
when I wrote the function in html it worked, but in the external file nothing happens.