View Single Post
  #2   Spotlight this post!  
Unread 11-02-2012, 22:01
HansJ's Avatar
HansJ HansJ is offline
Registered User
AKA: Hans
FRC #3018 (Nordic Storm)
Team Role: Mechanical
 
Join Date: Jan 2010
Rookie Year: 2010
Location: St. Peter
Posts: 29
HansJ is on a distinguished road
Re: Help with website

Add a set of curly braces around the code you want in the function e.g.

Code:
var a =1;
function displayDate()
{
	a=a+2;
	if (a==1)
	{
		document.getElementById("demo").innerHTML="Hello";
	}
	else
	{
	document.getElementById("demo").innerHTML="GoodBye ";
	}
}
The if statement that changes the innerHTML was not being called when you clicked the button, only the addition part

Make sense?
__________________


2013 Lake Superior Excellence In Engineering Winner
2013 Lake Superior Dean's List Finalist
2013 10,000 Lakes Engineering Inspiration Winner
2013 Championship Creativity Award Winner

Last edited by HansJ : 11-02-2012 at 22:12. Reason: clarifying
Reply With Quote