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

Popular posts from this blog

javascript - Chart.js (Radar Chart) different scaleLineColor for each scaleLine -

apache - Error with PHP mail(): Multiple or malformed newlines found in additional_header -

java - Android – MapFragment overlay button shadow, just like MyLocation button -