My Math Forum  

Go Back   My Math Forum > Science Forums > Computer Science

Computer Science Computer Science Forum


Reply
 
LinkBack Thread Tools Display Modes
December 25th, 2013, 04:49 AM   #1
Senior Member
 
Joined: Oct 2012

Posts: 460
Thanks: 0

javascript- problems with windows.prompt!!!

Hello!
Please, if somone has nerves for a little bit of javascript, why is prompt frame to input a not apearing?
Where is the mistake?
many thanks!!!

Code:
<!DOCTYPE html>

<html>
  <body>
  
  
  

Please, input 3 numbers 1-9 separated with commas:</p>
  
  
  <input id="frame" type="array">
    
    <button onclick="myFunction()">Search!</button>
    <script>
    function myFunction()
    {
    var a=prompt("Please, input a number: ","a");
    var x=document.getElementById("angle").value;
   for (int i=0; i<5; i+=2){
   if (x[i]==a){alert("Number IS on the list!")} 
 
  

   else{alert("Number is NOT on the list!")}

    }  

   </script>
    </body>
  
  </html>
ungeheuer is offline  
 
January 9th, 2014, 06:32 PM   #2
Global Moderator
 
greg1313's Avatar
 
Joined: Oct 2008
From: London, Ontario, Canada - The Forest City

Posts: 7,547
Thanks: 925

Math Focus: Elementary mathematics and beyond
Re: javascript- problems with windows.prompt!!!

Code:
<!DOCTYPE html>

<html>
<head>
   <script>
	function myFunction()
	{
	   var i;
	   var flag = 0;
	   var a = prompt("Please, input a number: ", "");
	   var x = document.getElementById("frame").value;
	   for (i = 0; i < 9; i++)
           {
	      if (x[i] == a)
		    flag = 1;
           }
	   if (flag == 1)
	     alert("The number IS on the list!");
	   else
	     alert("The number is NOT on the list!");
	}
   </script>
</head>
   <body>
	

Please, input 5 numbers 1-9 separated with commas:</p>
	<input id="frame" type="array">
   	<button onclick="myFunction()">Search!</button>
    </body>
</html>
greg1313 is online now  
Reply

  My Math Forum > Science Forums > Computer Science

Tags
javascript, problems, windowsprompt



Search tags for this page
Click on a term to search for related topics.
Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
math word processing software for Windows kemp New Users 16 February 12th, 2015 08:17 AM
Birds and Windows Tamama Advanced Statistics 4 August 18th, 2012 08:05 PM
Mathematics of a JavaScript Cube? destryalhmns Algebra 0 October 26th, 2011 11:02 AM
Windows Vista johnny Computer Science 8 October 15th, 2007 02:51 PM
Windows Vista Infinity New Users 6 June 15th, 2007 01:52 PM





Copyright © 2017 My Math Forum. All rights reserved.