我不想在点击时交换图像,bt 如果我从下图点击到上图,但如果我点击该图像,它又不会出现在下图...我得到一些错误- x.attr("src") 是未定义的
$(document).ready(function () {
$('#sortdivlink').click(function () {
var x = $("img[src$='../Images/Sort_down.png'][name='stCodeDSC']");
if (x.attr("SRC") == "../Images/Sort_down.png") {
x.attr('src', x.attr('src').replace("../Images/Sort_down.png", "../Images/sort_up.png"));
}
else {
x.attr('src', x.attr('src').replace("../Images/sort_up.png", "../Images/Sort_down.png"));
}
});
});