Text Ads Only

Text Ads Only

336 x 280 Block ads

Notepad, could be simply be defined as a simple text editor that follows along Microsoft as an in-built computer software, or is a simple text editor for Microsoft Windows and a basic text-editing program which enables computer users to create documents. Notepad, is sometimes over-looked by some individuals or (computer newbies that claims and depends on already-made computer software’s used for creating both computer and mobile applications.

Notepad could be used to create certain programs like; Calculator, Calendar, etc.

So, today I’ve gotten you guys some little secrets or (Tricks) on how to create html calculator using notepad, interesting right? I know it should.

Then, if interested go grab a Coffee for easy digest and read-on…..

Below, are required codes to implement in your notepad and see how it should look as a result. Sure, just copy and paste the below given codes in your notepad then, get familiar with it. Then, finally get used to the codes and its meaning, and go ahead and boast to your friends that you can now create your own program/ software like Calculator in html using notepad.
But, before we proceed, we’re required and supposed to know about the html codes and its meaning. So, here are the meanings listed for easy understanding;

Learn what each html function is doing. The code you will use to create your calculator is made up of many pieces of syntax that work together to define different elements of a document. read on to learn what each line of text is doing in the code you'll be using to make your calculator.

html: This piece of syntax tells the rest of the document what language is being used in the code. In coding, a number of languages used to code, and <html> tells the rest of the document that it will be in - you guessed it! - html.

head: Tells the document that everything beneath it is data about data, also known as "metadata". The <head> command is usually used to define stylistic elements of a document, such as titles, headings, and so on. Think of it as an umbrella under which the rest of the code is defined.

title: This is where you will name the title of your document. This attribute is used to define what the title of the document will be when opened in an html browser.

body bgcolor= "#": This attribute sets the color of the code's background and body. The number in this set of quotes that appears after # corresponds to a predetermined color.

text= "": The word in this set of quotes sets the color of the text on the document.

form name="": This attribute specifies the name of a form, which is used to build the structure of what comes after it based on what Javascript knows that form name to mean. For example, the form name we will be using is calculator, which will create a specific structure to the document.

input type="": This is where the action happens. The "input type" attribute tells the document what sort of text the values in the rest of the brackets are. For example, they could be text, a password, a button (as it will be for a calculator), and so on.

value="": This command tells the document what will be contained in the input type specified above. For a calculator, these show up as our numbers (1-9) and operations (+,-,*,/,=).

onClick="": This syntax describes an event, which tells the document that something should occur when the button is clicked. For a calculator, we want the text that displays in each button to by understood as such. So, for the "6" button, we'll put document.calculator.ans.value+='6' between the quotes.

br: this tag initiates a line break in the document, so that whatever comes after it will appear a line below whatever came before it.

/form, /body, and /html: these commands tell the document that the corresponding commands that were initiated earlier in the document are now ending.

<title>Techteazer Calculator</title>
<body bgcolor= "#000000" text= "gold">
<form name="calculator" >
<input type="button" value="1" onClick="document.calculator.ans.value+='1'">
<input type="button" value="2" onClick="document.calculator.ans.value+='2'">
<input type="button" value="3" onClick="document.calculator.ans.value+='3'">
<input type="button" value="+" onClick="document.calculator.ans.value+='+'">

<input type="button" value="4" onClick="document.calculator.ans.value+='4'">
<input type="button" value="5" onClick="document.calculator.ans.value+='5'">
<input type="button" value="6" onClick="document.calculator.ans.value+='6'">
<input type="button" value="-" onClick="document.calculator.ans.value+='-'">

<input type="button" value="7" onClick="document.calculator.ans.value+='7'">
<input type="button" value="8" onClick="document.calculator.ans.value+='8'">
<input type="button" value="9" onClick="document.calculator.ans.value+='9'">
<input type="button" value="*" onClick="document.calculator.ans.value+='*'">
<input type="button" value="/" onClick="document.calculator.ans.value+='/'">

<input type="button" value="0" onClick="document.calculator.ans.value+='0'">
<input type="reset" value="Reset">
<input type="button" value="=" onClick="document.calculator.ans.value=eval(document.calculator.ans.value)">
<br>Solution is <input type="textfield" name="ans" value="">
Then, save the file with .html extensions. E.g; in the code ending like; after the document is pasted, when saving the file for instance, you want to save the file name with techteazercalculator, you’re required to save it as; techteazercalculator.html.
Saving the file with .html extension, means that you’re converting the hyper-text mark-up language as a webpage, for making it possible and easy previewing in the computer browser.
Did you really found this post/ article helpful? Then, appreciate us by sharing it with others (your friends, or your relatives) it could lend some hands to them in some ways don’t keep it alone.

Our sole drive: Sharing is Caring! Always be our guests if we deserve worth turn-back-for.
Text Ads Only
336 x 280 Block ads
Sharing Is Caring.

No comments:

Powered by Blogger.