I am trying to modify an array of HTML buttons using a JavaScript function called getButtons:
function getButtons() { // This function generates buttons displayed in the selection phase.
var trialButtons = [
'<button class="jspsych-btn" style="color:blue; font-size: 20px; background-color:#CD6155; border-width: 2px; position:absolute; left: 120px; top:20px; width:210px; height:170px" >%choice%</button>',
'<button class="jspsych-btn" style="color:blue; font-size: 20px; background-color:#D7BDE2; border-width: 2px; position:absolute; left: 120px; top:220px; width:210px; height:170px" >%choice%</button>',
'<button class="jspsych-btn" style="color:blue; font-size: 20px; background-color:green; border-width: 2px; position:absolute; left: 120px; top:420px; width:210px; height:170px" >%choice%</button>',
'<button class="jspsych-btn" style="color:blue; font-size: 20px; background-color:#F4D03F; border-width: 2px; position:absolute; right:120px; top:20px; width:210px; height:170px" >%choice%</button>',
'<button class="jspsych-btn" style="color:blue; font-size: 20px; background-color:#DC7633; border-width: 2px; position:absolute; right:120px; top:220px; width:210px; height:170px" >%choice%</button>',
'<button class="jspsych-btn" style="color:blue; font-size: 20px; background-color:#BDC3C7; border-width: 2px; position:absolute; right:120px; top:420px; width:210px; height:170px" >%choice%</button>',
'<button class="jspsych-btn jspsych-btn_instructions" style="position:absolute; left:180px; bottom:30px;" >%choice%</button>'
];
myButtons = [];
myButtons.push(trialButtons);
return myButtons[myButtons.length -1];
}
I am wondering how I can update my button styles across all buttons. Specifically, is there a way to change the border-color
property of all buttons to red?