Unable to get property 'options' in javascript -
i have javascript codes here :
function setoptdcsn(objid, objsrc){ var optobj = document.getelementbyid(objsrc); var newcbo = document.getelementbyid(objid); var i; var cntopt=1; (i=0; i<optobj.options.length; i++) { newcbo[cntopt] = new option(optobj[i].innerhtml,optobj[i].value); cntopt++; } }
but, when call function, says error: unable property 'options' of undefined or null reference.
error: unable property 'options' of undefined or null reference.
this means optobj
null , implication document.getelementbyid(objsrc);
null , therefore , element id objsrc
not exist.
Comments
Post a Comment