473,394 Members | 1,679 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

I need help with my function

Blue1244
It doesn't want to give the "correct" alert box. It always gives me the
Expand|Select|Wrap|Line Numbers
  1. confirm("Incorrect");
.


Expand|Select|Wrap|Line Numbers
  1. <!DOCTYPE hmtl>
  2. <html>
  3. <head>
  4. <style>
  5. #button2 {
  6.     display: none;
  7. }
  8. </style>
  9. </head>
  10. <script>
  11. function displayTwo()
  12. {
  13. document.GetElementbyId(button2).style.display="block";
  14. }
  15. </script>
  16. <script>
  17. function start()
  18. {
  19. var one = prompt("What is 3 * 4 ?");
  20.  
  21.  
  22. if (one!=12)
  23.   {
  24.  
  25.     alert("Correct!");
  26.  
  27.  
  28.   }
  29. else
  30.  {
  31.  
  32.     var x= confirm("Incorrect! Restart?");
  33.     if (x==true)
  34.     {
  35.         location.reload();
  36.     }
  37.     else
  38.     {
  39.         location.reload();
  40.     }
  41.  }
  42.  
  43. }
  44.  
  45. </script>
  46. <script type="text/JavaScript">
  47. var Name = prompt("What is your name?");
  48. </script>
  49.  
  50. <script type="text/JavaScript">
  51. document.write(Name);
  52. </script>
  53.  
  54. <center><button id="button1" onClick="start(); displayTwo()">First Question</button></center>
  55. <center><button id="button2" onClick="two()">Second Question</button></center>
  56.  
  57. </html>
  58.  
Aug 22 '13 #1

✓ answered by Dormilich

look closely at what you have written:

IF variable IS NOT 12 THEN correct

5 1163
Dormilich
8,658 Expert Mod 8TB
look closely at what you have written:

IF variable IS NOT 12 THEN correct
Aug 22 '13 #2
Oh I feel stupid :| lol thank you for letting me know my mistake, Mistakes are what i learn from.
Aug 22 '13 #3
I might be asking questions a lot I'm still trying to learn and you reply to everything so sorry if I start to annoy you. Most of them might make me look blonde though.
Aug 22 '13 #4
Dormilich
8,658 Expert Mod 8TB
so sorry if I start to annoy you.
that’s nothing. I’ve seen worse from people either unwilling to learn or unable to read.
Aug 23 '13 #5
I'm trying to learn, because i really want to be a person who codes for a living.
Aug 24 '13 #6

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: spawncamper | last post by:
Hi - I posted here a few weeks back and people were kind enough to help. In lieu of my PL/SQL class I take in a few weeks, I was hoping to get some more advice. Here's my scenario: I need a...
5
by: matthias_k | last post by:
Hi, I need to sort elements of a std::list using a function predicate, something like: bool predicate( const& M m1, const& M m2 ) { return m1.somedata < m2.somedata; } I tried to call...
1
by: Travis Stewart | last post by:
Hi, I've been working on some software to control an older GPIB card for the past couple of weeks. I have function prototypes in a header file pc-mate2.h and the functions are defined in...
26
by: _R | last post by:
Given that VS2005 has made an effort to clean up the syntax of VC++ (in C++/CLI), is there any future plans to do away with function protos, ala C#/VB? What are they needed for these days?
18
by: ben.carbery | last post by:
Hi, I have just written a simple program to get me started in C that calculates the number of days since your birthdate. One thing that confuses me about the program (even though it works) is...
4
by: B. Williams | last post by:
I have written this program for an assignment that requires a static member function to set a static data member, but I can't figure out how to get it to change the value once set. Would someone...
6
by: daveyand | last post by:
Hey Guys, I've stumped. I created a function that does various things to select boxes. Namely Get All selected indexes, populate array with these values
7
by: Laurent Pointal | last post by:
on win32] Given the following: 45 .... (<generator object at 0x00A79788>,) .... File "<stdin>", line 1 SyntaxError: invalid syntax
6
by: emre esirik(hacettepe computer science and enginee | last post by:
I need to function for polynom device, there are 2 polynom and its power max=5, and polynom array is integer I need to function which device two polynom , (two polynom device with not remaining
3
by: viki1967 | last post by:
Hi there. I have a problem with function updateSum(id). The code is this: <script language="javascript" type="text/javascript"> <!--
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.