编译时提示
行: 275
错误: 无法获取属性“setAttribute”的值: 对象为 null 或未定义部分源代码
函数部分
function movechessman(id)
{
var CMTM=document.getElementById(id.toString());//ChessMan To Move
var OP=document.getElementById('blacktable');//Old Position
CMTM.style.top='0px';//第275行
CMTM.style.left='0px';
CMTM.style.position='absolute';
document.getElementById('1').appendChild(CMTM);
OP.removeChild(CMTM);
}<input type="button" value="加载图片" onclick="movechessman(blackchessman1)" />
其中blackchessman,blacktable,和1都是已定义的id;
怎么解决啊!!!!!!javascriptstylenull属性变量