Save access to this scope
I have color stored in a data attribute on my button that I wanted to use in a toggle. However, when I tried to access the data information using this , no data was available. How can I keep my access to the correct this scope? I was trying to only toggle the given color for the elements which didn't contain Skip. html <div> <input id="toggleButton" type="button" value="Toggle" data-color="Red" /> </div> <div id="toggleSet"> <div>Element</div> <div>Skip</div> <div>Element</div> </div> css .ActivateRed{ color: red; } js $('#toggleButton').click(function(){ $("#toggleSet div").each(function