My DOM looks like this:
16条回答 时光说笑 (楼主) 2020-11-22 02:16 Just an addition, to make it even more tiny: $('#imgId').click(function(){ $(this).attr("src",$(this).attr('src') == 'img1_on.gif' ? 'img1_off.gif':'img1_on.gif'); }); 0 讨论(0) 查看其它16个回答 发布评论: 提交评论 加载中... 验证码 看不清? 提交回复
Just an addition, to make it even more tiny:
$('#imgId').click(function(){ $(this).attr("src",$(this).attr('src') == 'img1_on.gif' ? 'img1_off.gif':'img1_on.gif'); });