表中没有变化图片 [英] no change picture in table
本文介绍了表中没有变化图片的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有一张表,第2列是图片。
i想要点击行更改图片。
没有运行代码:
i have a table that column 2 is a picture.
i want while click on row change pic.
not run code :
$("tr").click(function () {
$(this).find("td:gt(0)").attr("src", "~/content/images/img/mail_open.gif";);
});
推荐答案
( tr)。click( function (){
("tr").click(function () {
( this )。find( td:gt(0)) .attr( src, 〜/ content / images / img / mail_open.gif;);
});
(this).find("td:gt(0)").attr("src", "~/content/images/img/mail_open.gif";); });
< td>
元素没有src
属性。您可能打算在< td>
中找到< img>
元素 :
The<td>
element does not have asrc
attribute. You probably intended to find the<img>
element within the<td>
:
这篇关于表中没有变化图片的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文