Change Image Color by clicking button

Asked

Viewed 691 times

0

I have several images, when clicking the button I want it to take the image ID pass this ID to Onchange function and run the function update(this.jscolor).

Below is the excerpt of the complete HTML code:

<button name="color1" class="jscolor" onchange="update(this.jscolor)" 
   style="width:163px; height:46px; border:0px; margin:0px; padding:0px;"
   id="color_value" value="1085A9">
</button>
  • You can add the html code of the form in the question?

  • @Diegofelipe follows above html code

  • add the code of update(color)

  • you that this input is a button whose only function is to execute the onchange?

  • @Bia yes, that’s right.

  • Then Voce has some images, when clicking on this button it runs onChange and changes the color of the image?

  • @Bia yes, that’s right. How do I do it?

  • 1

    You described the whole process in your post, why don’t you try?

  • @Gladisonneuzaperosini would serve you if each image had a checkbox, and for all checkbox marked when clicking the button the color changes?

Show 4 more comments
No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.