hide/show a image in jquery

前端 未结 7 1429
逝去的感伤
逝去的感伤 2021-02-14 16:57

How to show/hide the image on clicking the hyperlink?



        
相关标签:
7条回答
  • 2021-02-14 18:00
    <script>
    function show_image(id)
    {
        if(id =='band')
        {
           $("#upload").hide();
           $("#bandwith").show();
        }
        else if(id =='up')
        {
            $("#upload").show();
            $("#bandwith").hide();
        }
    } 
    </script>
    
    <a href="#" onclick="javascript:show_image('bandwidth');">Bandwidth</a>
    <a href="#" onclick="javascript:show_image('upload');">Upload</a>
    
    <img src="img/im.png" id="band" style="visibility: hidden;" />
    <img src="img/im1.png" id="up" style="visibility: hidden;" />
    
    0 讨论(0)
提交回复
热议问题