answersLogoWhite

0


Best Answer

Here is a JavaScript option for determining if a number is odd or even. It even lets you know if the number is zero (if you want zero to be neither odd nor even).

var n = prompt("Enter a number to identify as odd or even", "Type your number here");

n = parseInt(n);

if (isNaN(n))

{ alert("Please Enter a Number"); }

else if (n == 0) { alert("The number is zero"); }

else if (n%2) { alert("The number is odd"); }

else { alert("The number is even"); }

User Avatar

Wiki User

9y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: Can identify the odd and the even in the java script using HTML?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Continue Learning about Engineering

What are the merits and demerits of using HTML to develop a website?

The biggest merit of HTML to develop a website is that it is required. You can not display a website without using some type of HTML, even when developing complex .NET pages.


Program for create a student detail in a table using HTML?

Oracle is a great program for creating a student detail in a table using HTML. One can even use a word processing platform too.


Special HTML characters?

There are 255 special HTML characters. The list would be to extensive to even post here. Not to mention I do not know if it would mess with the script of this site. Your best bet is to search the internet for the words "Special HTML Characters"and it will display many websites explaining this. If you still wish for me to post the information here let me know and I will figure out how to make it happen.


What java script or html code to hide the browsing history inside iframe just doing basic html code while navigating inside an iframe you do not wish the browsing history appears in the address bar?

Unfortunately, there is not a way to completely hide the iframe contents from the browser history using code on the site alone. Even though using a frame and using the source of your link to control the frame will not cause the URL to be written to your address bar(it will display the url of the site that contains the iframe) it is still being loaded by your browser and will appear in the browser history.


What is the code to create web browser using HTML?

You can not create a browser using HTML--you would have to use some other programming language. In order to make a browser which can read HTML, you basically just need something that can correctly parse SGML and display it in an intelligent way--technically, to read HTML it doesn't even need to give the text the styles, an example is the text-only Lynx browser.

Related questions

What are the merits and demerits of using HTML to develop a website?

The biggest merit of HTML to develop a website is that it is required. You can not display a website without using some type of HTML, even when developing complex .NET pages.


What is the book script of Buddhism?

There is no specific script of writing for Buddhism. The Tipitika was first written down using Sinhalese characters or script, but it has also been written down using many other scripts, such as Burmese, Thai, even Roman characters!


I have a HTML website I want to use a php script I have but the main php file has the info in it and I want it to be on the HTML site how can I embed or use the php code without using frames?

change the extention of the .HTML file to .php and then open the file that was previously HTML and put <?php include ("path/to/second/php/file.php"); ?> so for example if i have page1.HTML and page2.php i rename page1.HTML to page1.php and then put <?php include ("page2.php"); ?> where i want page2 to appear. Note: Any HTML file can be renamed to have a .php extention even if it doesnt contain any PHP.


In a letter where do you put the PS?

In a letter, you would 'add the ps' after (below) signing the letter. A Post script can be added by using the initials like so:P.s: Or, you may even add a Post post script by using THESE initials:P.p.s: I hope this posting of Post script and Post post script usage is of some use to you.


Program for create a student detail in a table using HTML?

Oracle is a great program for creating a student detail in a table using HTML. One can even use a word processing platform too.


How do you create an odd or even script using PHP?

To determine whether a given number is odd or even: function odd_even($i) { return ($i % 2 == 0 ? 'even' : 'odd'); }


How do you get an HTML link that just shows more info on a page but doesn't take you to a different page or site?

You would need to make the target of the HTML link to be a Java Script rather than a web page. The java script can then hide/show parts of a page (using DHTML) or even go off to the Internet to download information and then display it on the same existing web page (using AJAX). The "A" tag would look something like this: <a href="javascript:revealAnswer()">Click to see the answer</a> Here is a good web site that explains DHTML: http://www.w3schools.com/dhtml/dhtml_examples.asp


Special HTML characters?

There are 255 special HTML characters. The list would be to extensive to even post here. Not to mention I do not know if it would mess with the script of this site. Your best bet is to search the internet for the words "Special HTML Characters"and it will display many websites explaining this. If you still wish for me to post the information here let me know and I will figure out how to make it happen.


What java script or html code to hide the browsing history inside iframe just doing basic html code while navigating inside an iframe you do not wish the browsing history appears in the address bar?

Unfortunately, there is not a way to completely hide the iframe contents from the browser history using code on the site alone. Even though using a frame and using the source of your link to control the frame will not cause the URL to be written to your address bar(it will display the url of the site that contains the iframe) it is still being loaded by your browser and will appear in the browser history.


What is the code to create web browser using HTML?

You can not create a browser using HTML--you would have to use some other programming language. In order to make a browser which can read HTML, you basically just need something that can correctly parse SGML and display it in an intelligent way--technically, to read HTML it doesn't even need to give the text the styles, an example is the text-only Lynx browser.


What is the difference HTML and Text?

HTML is a code or scriptive language that usually executes java script; it can thus include photos and illustrations. Text is just a collection of letters one reads or may be used to store data such as keyboard configuration for a game. When you are asked about whether you want to receive a file as plain text or as HTML, the plain text version would just have the printed words, whereas the HTML would have photos, illustrations, maybe even video.


What is are plug ins?

An Internet plugin is anything that uses a feature outside of HTML; That interactive hotel page, for example. Or a flash game. Even chat rooms, generally speaking, use some outside script. Simply, a plugin is a program (or file written for such) that is part of your browser and seamlessly incorporates elements not achievable with HTML.