so, i have a website im building just for something to do.
I do not have a lot of experience with javascript but i want this link of code to apply to 4 buttons and it changes the src and whatever is between the square brackets based on what button it is.
function changehome(){
document.images["homeimg"].src= "homelinku.jpg";
return true;
}
Can anyone show me how this can be done, i expected it to be possible using the parentheses?
You can define function with parameters and pass their to the function:
…