Mellow Posted May 31, 2018 Share Posted May 31, 2018 Hello guys and girls out there, i need your help. I have this code where everytime u tap on a picture adds 1 value, i want to know if i can make it show a picture on 100 clicks <div style=" text-align: center;" <h1>Hello my friend if you love chocobos, then you are the right place</h1> <br> <script type="text/javascript"> var Love = 0; function onClick() { Love += 1; document.getElementById("Love").innerHTML = Love; }; </script> <input type="image" src="heart.png" onclick="onClick ()" width="62" height="62" /> <p>Love given: <a id="Love">0</a></p> </div> Link to comment Share on other sites More sharing options...
dsonesuk Posted May 31, 2018 Share Posted May 31, 2018 Use if condition to check value of Love variable, when it is 100 add path to image to img tag src. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now