HTML script
How do I make this script be able to work using L and R on keyboard instead of onclick and on line 35 there's a description pointing out what do I put in it *s means script it just doesn't let me post if I put it there <html> <head> <title>VS</title> <style> #left, #right{ position:absolute; top:0; bottom:0; cursor:pointer} #left{ right:0; color: #eee;} #right{ right:0; color:#900;} #left div, #right div, #vs{ position:absolute; top:50%; left:50%; margin: -50px 0 0 -50px; width: 100px; height: 100px; text-align: center; font-weight: bold; font-size: 50px; line-height: 100px; border-radius: 50px; } #right, #left div{background-color: #900;} #left, #right div{background-color: #eee;} #vs{background-color: #eee; color:#fff; box-shadow: 2px 2px 5px #000;} </style> </head> <body> <div id="left" onclick="left_click()"><div></div></div> <div id="right" onclick="right_click()"><div></div></div> <div id="vs">VS</div> *s var left = 0, right = 0 var leftDiv = document.getElementById("left"); var rightDiv = document.getElementById("right"); var vsDiv = document.getElementById("vs"); function refresh(){ leftDiv.style.width = (50 + left - right).toString() + "%"; rightDiv.style.width = (50 - left + right).toString() + "%"; leftDiv.firstChild.innerHTML = left; rightDiv.firstChild.innerHTML = right; } function left_click(){ left++; refresh(); } function right_click(){ /* do I put in right++; refresh(); in here? */} *s </body> </html>