0

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 loading type button.

Thanks

2
  • 1
    Which language are you using? Commented Nov 4, 2010 at 20:28
  • sorry for being unclear, it's PHP and Javascript Commented Nov 4, 2010 at 23:03

2 Answers 2

3

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>
Sign up to request clarification or add additional context in comments.

Comments

0

set the image's visible property to true?

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.