奇怪,贴代码!<a href="kk.html"><img src=""></a><a href="kk.html"></a><img src="">

解决方案 »

  1.   

    document.onselectstart = function()
    {
        var oObject = event.srcElement;
        if(oObject.tagName.toLowerCase() != "input"
            &&oObject.tagName.toLowerCase() != "textarea")
    {
    return false;
    }
    }
    ondragstart="return false"
      

  2.   

    如果你想在img上做点什么:)就用oObject.tagName.toLowerCase() != "img" 捕获就可以了:)
      

  3.   

    其实主要就是屏蔽鼠标不可以点击除input 和 textarea以外的元素:)当然也包括图片了:)呵呵
      

  4.   

    <a href="http://www.csdn.net" target="_blank" id="link1"><img src="..." border=0></a><input type=button value="连接无效" onclick="document.getElementById('link1').onclick=function() {return false};"><input type=button value="连接有效" onclick="document.getElementById('link1').onclick=function() {return true};">
      

  5.   

    <img src="...">不是放到<a></a>中的,是用JS控制打开的一个新网页,是不是有一个disabled属性,如果这个属性为true,是不是就不能打开了.
      

  6.   

    <script>
    function cando()
    {
    if (document.all.b1.value=="canclick")
    {
    document.all.b1.value="cannotclick";
    a1.innerHTML="<img border=0 src=a.gif>";
    }
    else
    {
    document.all.b1.value="canclick";
    a1.innerHTML="<a href=#><img border=0 src=a.gif style=\"cursor:hand\"></a>";
    }
    }
    </script>
    <body>
    <form>
    <span id=a1><a href=#><img border=0 src=a.gif style="cursor:hand"></a></span>
    <input name=b1 type=button value="canclick" onclick="cando()">  
    </form>
      

  7.   

    不可以点击??不可以点击时,就不调用onclick不就行了吗??