in the console its giving me the error 'position not defined' using the the code below.. any ideas?
var x = 1;
var y = 1;
function getyx(y, x) {
var yx = 'Y' + y + 'X' + x ;
return yx;
}
function getPosition() {
var position = document.getElementById(getyx(y,x));
return position;
}
function moveSprite() {
position.appendChild(img); //error occurs here
}
Maybe get element by Id cant accept a function ? I know this may be a silly question but forgive me :)
GetPosition().appendChild(img);