473,698 Members | 2,554 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

I need help with my function

Blue1244
39 New Member
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
5 1169
Dormilich
8,658 Recognized Expert Moderator Expert
look closely at what you have written:

IF variable IS NOT 12 THEN correct
Aug 22 '13 #2
Blue1244
39 New Member
Oh I feel stupid :| lol thank you for letting me know my mistake, Mistakes are what i learn from.
Aug 22 '13 #3
Blue1244
39 New Member
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 Recognized Expert Moderator Expert
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
Blue1244
39 New Member
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
4184
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 function to return a table of data for Oracle8i. I'm fairly certain of the stucture for the function, but am hazy on the details.
5
7357
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 std::list::sort with such a predicate but that doesn't work:
1
11987
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 pc-mate2.c. I am using the Borland Turbo C 2.01 compiler (it is the compiler that the person I am writing this for uses) and when I compile the program I am writing I get an error: Turbo Link Version 2.0 Copyright (c) 1987, 1988 Borland...
26
1949
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
3129
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 how global variables and function returns work... For example, I have a global array "char datestring;" which is defined in the function speakdate. speakdate just converts a set of integers (date variables) to a string.
4
1571
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 point me in the right direction. I'll post all of my code, but what I need help with is the static member function. Thanks in advance. // prevent multiple inclusions of header file #ifndef SAVINGSACCOUNT_H
6
1752
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
8113
by: Laurent Pointal | last post by:
on win32] Given the following: 45 .... (<generator object at 0x00A79788>,) .... File "<stdin>", line 1 SyntaxError: invalid syntax
6
1874
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
1456
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
8685
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8612
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9171
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9032
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8880
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7743
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5869
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
1
3053
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2008
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.