开发者

Display image on click in HTML / Javascript

开发者 https://www.devze.com 2023-01-23 19:27 出处:网络
hey, how can I make an image visible when a user clicks a button? Using Html / Javascript Also, the button is submitting a form which is going to a different url, it just takes a while to load the ot

hey, how can I make an image visible when a user clicks a button? Using Html / Javascript

Also, the button is submitting a form which is going to a different url, it just takes a while to load the other page, therfore I want a开发者_如何学Python loading type button.

Thanks


It's simple to acheive this across all modern browsers using jQuery:

<input type="submit" value="Show Image" id="showButton" />
<img src="blank.gif" id="blankImage" alt="blank" style="display: none;" />

<script type="text/javascript">
$('#showButton').click( function() {
    $('#blankImage').show();
    return false;
});
</script>


set the image's visible property to true?

0

精彩评论

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