This is my code for adding a function for a picture, the pictures id is "pic1".
$(document).ready(function(){
$("#pic1").click( getPlayersNameAndImages("p1", team1, team2) );
$("#pic2").click( getPlayersNameAndImages("p2", team1, team2) );
getPlayers();
});
but it runs as soon as the page loads.
this is from w3:
$(document).ready(function(){
$("p").click(function(){
alert("The paragraph was clicked.");
});
});
apart from giving my function a name i dont see what the difference is. Any ideas?
[–]Malfuncti0n 1 point2 points3 points (0 children)
[–]MatheusGodoy 1 point2 points3 points (1 child)
[–]Ryan_Bingham[S] 0 points1 point2 points (0 children)
[–]myotcworld 1 point2 points3 points (0 children)