Help On This Simple Script - Programming - Nairaland
Nairaland Forum › Science/Technology › Programming › Help On This Simple Script (862 Views)
1 Reply
| Help On This Simple Script by Setag(op): 6:21pm On Aug 15, 2015 |
Function count() {
var lbl= document.getElementById('lbl');
for (i=0; i<10; i++) {
lbl.innnerHTML+= i+'<br>';
}
} the tags specifically: <button type='button' onclick='count()'>start counting </button> <div id='output'></div> i keep getting the this error on IE: unable to get property 'innerHTML' of undefined or null reference. Kinda fix this and explain.. Re: dhtml |
| Re: Help On This Simple Script by hollyfat(m): 9:54pm On Aug 16, 2015 |
Setag:The problem is that there is no tag with id lbl. you can try this out function count() { var output= document.getElementById('output'); for (i=0; i<10; i++) { output.innnerHTML+= i+'<br>'; } } <button type='button' onclick='count()'>start counting </button> <div id='output'></div> The div tag with the output attribute(<div id='output'></div> will contain the loop results |
| Re: Help On This Simple Script by Kensharval(m): 8:59pm On Aug 18, 2015 |
If you wish to have a professional shared
hosting quality in a free hosting package, come
and host with 000webhost.com and
experience the best service you can get
absolutely free.
Founded in December 2006, 000webhost.com
has a trusted free hosting members base of
over 60,000 members and still counting!
Offering professional quality hosting, support,
uptime and reliability, we have a great
community of webmasters, you'd love to be a
part of!
Register now and get it all free:
*** 1500 MB of disk space
*** 100 GB of data transfer
*** PHP and MySQL support with no
restrictions
*** cPanel control panel
*** Website Builder
*** Absolutely no advertising!
Join us now: http://
www.000webhost.com/876430.html |
Allow Me To Ask You This Simple Question About Your Business • Help A Java Newbie With This Simple Java Program • Help On This Simple Script • 2 • 3 • 4
#madeinnigeria -incredible:nigerian Boy In Jss3 Built A Radio With Four Lamps An • Before You Hire That Teenager…….. Possible Landmines • Best Quiz Game
will contain the loop results