0
Help with jQuery click event to change background color
I set a div (class=âitemâ id=âbackâ) I set css with jQuery â(document).readyâ Itâs fine so far, the problem comes when I want to use addClass to this div after clicking another div (id=âjoyasâ) It goes like: $(document).ready(() => { $(â#backâ).addClass(âindexbackâ); }); $(â#joyasâ).click(function() { $(â#backâ).addClass(âjoyasbackâ); }); Notes: .indexback class has linear gradient, and I want it to change to white when clicking the div âjoyasâ. So the class .joyasback has a solid white background.
1 RĂ©ponse
+ 2
Can you attach the code bit link please? incomplete snippet like this make it harder to find the problem cause there are things that aren't shown.
https://www.sololearn.com/post/75089/?ref=app