Basically there is an empty box with a submit button directly underneath. The empty box might have a default picture loaded to begin with. When a user clicks the submit button, how can I display a different picture (in place of the default) based on a certain time of the day. I don’t really need an answer regarding the checkTime logic, but I would appreciate some help with regards to the submit button being able to change a picture in the same spot. Thanks guys.
Basically there is an empty box with a submit button directly underneath. The empty
Share
if you just have a simple button, you can add an onclick event to it:
Example 1:
and your changeImage() function will have the logic to follow
Example 2:
Javascript –
images can be switched using the
srcpropertyjavascript –