I'm quite new to programming as a whole and extremely new to jquery. I'm trying to make it so every time I press the W key, my cube moves upward. I can make it grow in width with the 'width("+=__")' command, but I don't want it to do that. Is there something like that width command but instead of width it changes positioning? if not, is there a simple way I can make this work? Here's what i've got right now. Instead of changing width, I want to change the positioning somehow.
document.addEventListener('keypress', function(event){
if (event.key === 'w') {
document.getElementById('player').style.left = $('#player').width("+=50");
}
});