我需要使用javascript禁用img標記。什麼是JavaScript代碼?禁用img標記
例子:
<img id='hrefId' src="/proteus/images/button_find.gif" alt="" />
請幫我
我需要使用javascript禁用img標記。什麼是JavaScript代碼?禁用img標記
例子:
<img id='hrefId' src="/proteus/images/button_find.gif" alt="" />
請幫我
使用jQuery,您可以隱藏圖像:$("#hrefId").hide()
或添加CSS類,將其樣式爲禁用:$("#hrefId").addClass("disabled")
...
在我的項目中,我沒有允許使用jQuery。有沒有JavaScript代碼可以禁用img標籤 – Suga
首先告訴我們什麼是「禁用」圖像。這個概念不存在,所以你的意思不清楚。 – solendil
對不起,不清楚。標籤從開始。之後,它會出現單選按鈕。當他們點擊單選按鈕時,它應該禁用 ...我如何使用java腳本執行此操作... – Suga
這裏假定你的意思是「隱藏」禁用
<style type="text/css">
.disabled
{
display:none;
}
</style>
<img id='hrefId' src="/proteus/images/button_find.gif" alt="" />
<script languae="javascript">
var myPicture= document.getElementById('hrefId');
myPicture.className = "disabled";
</script>
document.getElementById('headname'+(t)).disabled=true;
document.getElementById('headname'+(t)).setAttribute("class","disabledcombo");
document.getElementById('img'+(t)).src='../images/editfin.gif' ;
document.getElementById('new'+(t)).src='../images/adds1.png' ;
document.getElementById('new'+(t)).className = "disabled";
請解釋你的意思是禁用img標籤? – Curt
禁用它如何? –