Skip to content
Advertisement

Trying to change background color on same valued inputs

I’ve been trying to change the input on a same valued inputs. The input ids are (Input${i} (Input0 , Input1 and etc., iterating them with loop), I have a button which evokes the function,

The best I got so far is this:

JavaScript

Advertisement

Answer

I think you probably want to learn to do something like:

JavaScript
JavaScript
JavaScript

You’ll notice this design supports more than one match.

User contributions licensed under: CC BY-SA
8 People found this is helpful
Advertisement