You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

17 lines
529 B

let page = document.getElementById('buttonDiv')
const kButtonColors = ['#3aa757', '#e8453c', '#f9bb2d', '#4688f1']
function constructOptions(kButtonColors) {
for(let item of kButtonColors) {
let button = document.createElement('button')
button.style.backgroundColor = item
button.addEventListener('click', function(){
chrome.storage.sync.set( {
color: item
},function () {
console.log('color is ' + item)
})
})
page.appendChild(button)
}
}
constructOptions(kButtonColors)