javascript - getting the size of a content box with javascriptHey -


this question has answer here:

i trying width of content box following comand:

var box = document.getelementbyid('player'); var boxsize = box.clientwidth; 

it seems return something. when alert it gives out number. still throws error:

uncaught typeerror: cannot read property 'clientwidth' of null 

what happening here?

var box = document.getelementbyid('player'); if(box){   var boxsize = box.offsetwidth; } 

Comments

Popular posts from this blog

PHP while loop dynamic rowspan -

android - How to read a column value in parse.com without accessing an object or a pointer -

timer - Java TimerTask cancel -