Show/hide image with JavaScript

后端 未结 6 649
抹茶落季
抹茶落季 2020-12-08 15:17

I have an HTML page with an image that I set to be invisible by CSS visibility: hidden. I want to make a link called \"Show image\", so that when I click on it,

6条回答
  •  眼角桃花
    2020-12-08 15:31

    Here is a working example: http://jsfiddle.net/rVBzt/ (using jQuery)

    
    
    click to toggle
    
    img {display: none;}
    
    a {cursor: pointer; color: blue;}
    
    $('#toggle').click(function() {
        $('#tiger').toggle();
    });
    

提交回复
热议问题