How to refresh only an element of a HTML page with Jquery or Javascript on clicking another element on the same page? I need to know this to implement a form captcha.
<img src="includes/captcha.php" style="padding:10px 0;"/>
<img src="images/refresh.gif" onclick="window.location.reload()" style="cursor:pointer; padding:10px 0;" />
i want to reload the image generated wih captcha.php by clicking on refresh.gif. The current code reloads the complete page.
This does not require any jquery. Simply alter the images
srcattribute to include some additional random data.Alter your image tag to set an ID like this.
And add the call to the function in your refresh image.