Adding OnClick attributes to elements

$(document).ready(function() {
  $('#groutWhite').attr("onclick", "activateColor('White');");
  $('#groutGray').attr("onclick", "activateColor('Gray');");
  $('#groutBuff').attr("onclick", "activateColor('Buff');");
  $('#groutRed').attr("onclick", "activateColor('Red');");
  $('#groutBrown').attr("onclick", "activateColor('Brown');");
  $('#groutBlack').attr("onclick", "activateColor('Black');");
  $('#groutCloseup').attr("onclick", "activateColor('Closeup');");
});

Leave a Reply