What script should I use to create a clickable selection/deselection function to change the font color for a large set of different elements? I don't have too much experience with web development. This is probably trivial to implement, but I don't know where to start or what the best solution might be. I hope my use case is reasonably clear. The code might look something like this:
<!-- CSS -->
.selection {
color: #E5E5E5;
}
<!-- HTML -->
<element selector="k1">Select/Deselect Keyword 1</element>
<element selector="k2">Select/Deselect Keyword 2</element>
<p class="k1">Keyword 1</p>
<p class="k2">Keyword 2</p>
<p class="k2">Keyword 2</p>
<!-- JS -->
var array=[];
$('element').click(function() {
$(this).toggleClass('selection');
$var selection=$(this).attr('selector')
if($(this).hasClass('selection');
...
$('.k1')...
$('.k2')...
}