开发者

display image in mvc2 after button click

开发者 https://www.devze.com 2023-02-20 17:48 出处:网络
i need to display an image开发者_JS百科 only after a button click in asp.net mvc2 but i am getting it even before click as well as after click

i need to display an image开发者_JS百科 only after a button click in asp.net mvc2 but i am getting it even before click as well as after click can someone give me a solution as to why this is happenning??


Try something on the lines of:

<html>
<head>
  <script src="http://code.jquery.com/jquery-1.5.js"></script>
</head>
<body>
  <button>Show it</button>

      <img src="url" style="display: none" />
<script>
    $("button").click(function () {
    $("img").show("slow");
    });
    </script>

</body>
</html>

http://api.jquery.com/show/

0

精彩评论

暂无评论...
验证码 换一张
取 消