₦airaland Forum

Welcome, Guest: RegisterLoginWith GoogleTrendingRecentNew

Stats: 3,325,000 members, 8,419,871 topics. Date: Thursday, 04 June 2026 at 05:29 AM

Toggle theme

Help On This Simple Script - Programming - Nairaland

Nairaland ForumScience/TechnologyProgrammingHelp 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:
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
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>wink 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
1 Reply

Allow Me To Ask You This Simple Question About Your BusinessHelp A Java Newbie With This Simple Java ProgramHelp On This Simple Script234

#madeinnigeria -incredible:nigerian Boy In Jss3 Built A Radio With Four Lamps AnBefore You Hire That Teenager…….. Possible LandminesBest Quiz Game