gpt4 book ai didi

javascript - 单击时更改超链接图像

转载 作者:行者123 更新时间:2023-11-28 20:33:30 25 4
gpt4 key购买 nike

您好,我正在尝试更改超链接单击的图像,如下所示。但选择按钮的图像没有更改为loading.gif。我究竟做错了什么?我是 jquery 新手。感谢期待

 <HTML><HEAD>
<SCRIPT type=text/javascript src="jquery.js"></SCRIPT>
</HEAD>
<BODY>
<TABLE>
<TBODY>
<TR>
<TD><A id=webservice_submit href="javascript:document.frm_correction.submit()" jQuery1365443220846="2">
<IMG onmouseover="MM_swapImage('Correction subj','','http://localhost:6868/corrmgr/img/select_up.gif',0)" onmouseout=MM_swapImgRestore() name="Correction Subj" alt="Correction Subj" src="http://localhost:6868/corrmgr/img/select.gif" oSrc="http://localhost:6868/corrmgr/img/select.gif">
</A></TD></TD></TR></TBODY></TABLE>
<DIV style="DISPLAY: none" id=loading jQuery1365443220846="3"><IMG name="Please wait..." alt="Please wait while the request is being processed..." src="http://localhost:6868/corrmgr/img/bert2.gif"> </DIV>
<SCRIPT language=javascript>
var $loading = $('#loading');

$('#webservice_submit').click(function(){
$loading.toggle();
if( $loading.is(':visible') ){
alert("invoking web services");
$('#image img').attr('src', 'http://localhost:63531/corrmgr/img/loading.gif');
return ($(this).attr('disabled')) ? false : true;
}
});

$('#loading').hide();
</SCRIPT>
</BODY></HTML>

最佳答案

您的选择器不正确。更改此:

$('#image img')

对此:

$('#image')

并给出<img>对应id :

<IMG id="image" ...>

关于javascript - 单击时更改超链接图像,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15885776/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com