I have a function that fires when onchange happens. However event.target.value shows that “on” is the value. I am trying to have an object update with a checked mark show up when the box is checked.
<script type="text/javascript">
let lizt = {
"learn": {
"react": true,
"python": false,
"nodejs": false
}
}
let lixxt = lizt["learn"];
let order = document.getElementById("order")
let status = lizt["learn"] ? '' : 'checked';
for (stuff in lixxt){
let status = !lixxt[stuff] ? '' : 'checked';
order.innerHTML += '<li>' + '<input type="checkbox"+ ' + status + '>' + stuff + '</li>'
}
order.onchange = markit;
function markit(){
let key = event.target.value;
console.log(key)
}