开发者

Display image on click in HTML / Javascript

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜