load an image after clicking a button

前端 未结 3 1635
一向
一向 2020-12-20 09:34

I have a

3条回答
  •  有刺的猬
    2020-12-20 10:22

    Change your code to this:

    $(document).ready(function(){
    $("button").click(function(){
        var imgUrl = $(this).data('rel');
        $("#area").html("description");
      });
    });
    
    
    

    Fiddle: http://jsfiddle.net/x3QdU/4/

提交回复
热议问题