Lida 1578 vezes
function show_img(){ var another_img = '/images/another_img.jpg'; $("img#click").attr('src', another_img);}//ou, mas entao nao precisas de onclick="" em img tag$(document).ready(function() { var another_img = '/images/another_img.jpg'; $("img#click").click(function(){ $(this).attr('src', another_img);});});
<img id="click" onclick="show_img()" src="/images/first_img.png" alt="Show Code" title="Show code" />
Desenvolvimento
WordPress
Social Media