Showing posts with label simple. Show all posts
Showing posts with label simple. Show all posts
Saturday, April 22, 2017
How to create a Simple calculator Using HTML and JavaScript
How to create a Simple calculator Using HTML and JavaScript
Here are the steps to create a simple calculator using HTML and JavaScript which can evaluate simple arithmetic on integer numbers. Two types of inputs text and button are used here on a table within a form element and OnClick event was used to insert button values on the screen or to evaluate the numbers.
1. At first Insert a <form> element within <body> tag.
2. Create a table using <table> .....</table> tag.
3. Insert two types of Input text and button within table data of table row using <tr><td>....</td></tr> tag.
4. Assign OnClick event for all the buttons having numbers and arithmetic operators.
5. Give blank value for Clear(C) button.
6. Use eval() function to evaluate the numbers on OnClick event of equal to sign button.
Steps to create a Simple calculator Using HTML and JavaScript
1. At first Insert a <form> element within <body> tag.
2. Create a table using <table> .....</table> tag.
3. Insert two types of Input text and button within table data of table row using <tr><td>....</td></tr> tag.
4. Assign OnClick event for all the buttons having numbers and arithmetic operators.
5. Give blank value for Clear(C) button.
6. Use eval() function to evaluate the numbers on OnClick event of equal to sign button.
Full HTML code for a Simple HTML calculator
<html>
<head></head>
<body>
<h3>Simple Calculator</h3>
<br/>
<form Name="calc">
<table border=2>
<tr>
<td colspan=4><input type=text Name="display"></td>
</tr>
<tr>
<td><input type=button value="0" OnClick="calc.display.value+=0"></td>
<td><input type=button value="1" OnClick="calc.display.value+=1"></td>
<td><input type=button value="2" OnClick="calc.display.value+=2"></td>
<td><input type=button value="+" OnClick="calc.display.value+=+"></td>
</tr>
<tr>
<td><input type=button value="3" OnClick="calc.display.value+=3"></td>
<td><input type=button value="4" OnClick="calc.display.value+=4"></td>
<td><input type=button value="5" OnClick="calc.display.value+=5"></td>
<td><input type=button value="-" OnClick="calc.display.value+=-"></td>
</tr>
<tr>
<td><input type=button value="6" OnClick="calc.display.value+=6"></td>
<td><input type=button value="7" OnClick="calc.display.value+=7"></td>
<td><input type=button value="8" OnClick="calc.display.value+=8"></td>
<td><input type=button value="x" OnClick="calc.display.value+=*"></td>
</tr>
<tr>
<td><input type=button value="9" OnClick="calc.display.value+=9"></td>
<td><input type=button value="C" OnClick="calc.display.value="></td>
<td><input type=button value="=" OnClick="calc.display.value=eval(calc.display.value)"></td>
<td><input type=button value="/" OnClick="calc.display.value+=/"></td>
</tr>
</table>
</form>
</body>
</html>
Preview of Simple HTML calculator
Related Search Terms
Simple Calculator Usnig JavaScript
Simple Calculator Usnig HTML
How to create a Calculator
Related Posts:
How to use Round, Random, Min and Max in JavaSript
How to Concatenate, Join and Sort Array in JavaScript?
How to Loop Through JavaScript Array?
How to Loop using JavaScript?
How to Show Pop Up Boxes Using JavaScript?
How to Write Conditional Statements in JavaScript?
How to Write JavaScript With HTML?
How to create Changeable Date and Time Using JavaScript?
How to Validate a HTML Form Using JavaScript?
How to create a simple form using HTML?
How to Create JavaScript Image Slideshow with LInks
How to Display Date Format in JavaScript?
How to Validate a HTML Form Using JavaScript?
What are the Different Ways to Redirect Page in JavaScript?
How to Detect Visitors Browser Using JavaScript?
How to make rounded corners border using CSS
How to Create Custom CSS Template for Printing
How to create a simple form using HTML?
Go to link Download
Labels:
a,
and,
calculator,
create,
how,
html,
javascript,
simple,
to,
using
Monday, February 6, 2017
How to create a simple form using HTML
How to create a simple form using HTML
From is a necessary element in any website or blog. Mostly they are used to take user information for any of the purposes like logging into the user account, creating user account, allowing to subscribe malling list, allowing users to submit comments and allowing users to contact website admin, support or sales team.
Here I am going to describe "How to create a simple form using HTML" step by step with describing what is a form and what elements are used to create HTML form along with complete HTML code for a form.
A form is an area that contain form elements. You must set up a form before adding in run to the web page. To setup a form, you need to specify two important information Method and Action.
Method is a property tells the form how to transfer the data to the form processor. The value for method can be post or get In post method you are just posting information and method get means that you are just going to get another page. In almost all of the form post method is used.
Action property tells what action the form should take when the user presses the submit button. Action is the URL to which you are posting the information.
We have to use different HTML tags to create a form. The most commonly used HTML tags to create a form are listed below.
<INPUT> Tag: The most form tag is <INPUT> tag. The type of INPUT is specified with the TYPE attribute. This tag doesnt have its ending tag. The most commonly used INPUT types are listed below:
TEXT: It is used for plain type of text input. The attributes used in this type are NAME, VALUE, SIZE and MAXLENGTH.
Example: <INPUT TYPE="TEXT" NAME="UserName" VALUE="Username" SIZE=16 MAXLENGTH=15>
PASSWORD: It is used for password type of text input. The attributes used in this type are NAME, VALUE, SIZE and MAXLENGTH.
Example: <INPUT TYPE="PASSWORD" NAME="Password" VALUE="Password" SIZE=16 MAXLENGTH=15>
RADIO: It is used for single choice input system. The attributes used in this type are NAME, VALUE and CHECKED
Example: <INPUT TYPE="radio" NAME="sex" VALUE="M" CHECKED>
CHECKBOX: It is used for multiple choice input system. The attributes used in this type are NAME and VALUE.
Here I am going to describe "How to create a simple form using HTML" step by step with describing what is a form and what elements are used to create HTML form along with complete HTML code for a form.
A form is an area that contain form elements. You must set up a form before adding in run to the web page. To setup a form, you need to specify two important information Method and Action.
Method is a property tells the form how to transfer the data to the form processor. The value for method can be post or get In post method you are just posting information and method get means that you are just going to get another page. In almost all of the form post method is used.
Action property tells what action the form should take when the user presses the submit button. Action is the URL to which you are posting the information.
We have to use different HTML tags to create a form. The most commonly used HTML tags to create a form are listed below.
Different Tags for HTML Form
<INPUT> Tag: The most form tag is <INPUT> tag. The type of INPUT is specified with the TYPE attribute. This tag doesnt have its ending tag. The most commonly used INPUT types are listed below:
TEXT: It is used for plain type of text input. The attributes used in this type are NAME, VALUE, SIZE and MAXLENGTH.
Example: <INPUT TYPE="TEXT" NAME="UserName" VALUE="Username" SIZE=16 MAXLENGTH=15>
PASSWORD: It is used for password type of text input. The attributes used in this type are NAME, VALUE, SIZE and MAXLENGTH.
Example: <INPUT TYPE="PASSWORD" NAME="Password" VALUE="Password" SIZE=16 MAXLENGTH=15>
RADIO: It is used for single choice input system. The attributes used in this type are NAME, VALUE and CHECKED
Example: <INPUT TYPE="radio" NAME="sex" VALUE="M" CHECKED>
CHECKBOX: It is used for multiple choice input system. The attributes used in this type are NAME and VALUE.
Example: <INPUT TYPE="checkbox" NAME="MCQ" VALUE="M">
RESET: It is used to reset values entered in a form. Value is the attribute of RESET type of INPUT.
Example: <INPUT TYPE="reset" VALUE="Clear Form">
SUBMIT: It is used to submit values entered in a form. Value is the attribute of SUBMIT type of INPUT.
Example: <INPUT TYPE="submit" VALUE="Submit">
<TEXTAREA> Tag: This tag is used to specify the area of the text. This tag makes a two dimensional text area, in which viewer can type from a short sentence to many paragraphs. This tag has its ending tag and it is mostly used to create comment form or contact form. The attributes in this tag are NAME, VALUE, COLS and ROWS.
Example: <TEXTAREA NAME="Details" COLS=30 ROWS=5></TEXTAREA>
<SELECT> Tag: This tag is used to create a menu that offers visitors a list of option to choose from. This tab has also its ending tag. The attributes in this tag are NAME, MULTIPLE and SIZE.
Example: <SELECT NAME="Menu" MULTIPLE SIZE=3><OPTION>.....</SELECT>
<OPTION> Tag: It is the mini tag of <SELECT> tag. This tag is used to define the options to choose from the drop-down list. SELECTED is the attribute of <OPTION> Tag.
Example: <SELECT NAME="Menu" MULTIPLE SIZE=3><OPTION SELECTED>Programming Guide<OPTION>MCQs</SELECT>
Here is a sample form to allow users to create user and subscribe for the topics they want along with complete HTML code and its output.
HTML Code to Create a Simple Form
<html>
<head><title>Subscription Form</title></head>
<body>
<h1 align=center>Subscription Form</h1>
<br/>
<FORM METHOD=POST ACTION=mailto:siteforinfotech@gmail.com>
<DIV>First Name:<INPUT TYPE=text NAME=fname VALUE=Enter First Name SIZE=30 MAXLENGTH=25></DIV><br/>
<DIV>Last Name:<INPUT TYPE=text NAME=lname VALUE=Enter Last Name SIZE=30 MAXLENGTH=25></DIV><br/>
<DIV>Password:<INPUT TYPE=password NAME=password SIZE=30 MAXLENGTH=25></DIV><br/>
<DIV>Retype Password:<INPUT TYPE=password NAME=rpassword SIZE=30 MAXLENGTH=25></DIV><br/>
<DIV>Email:<INPUT TYPE=text NAME=email VALUE=Enter Your Email SIZE=30 MAXLENGTH=25></DIV><br/>
<DIV>Sex:<INPUT TYPE=radio NAME=sex VALUE=M>Male<INPUT TYPE=radio NAME=sex VALUE=F>Female</DIV><br/>
<DIV>Write About You:<TEXTAREA NAME=about COLS=30 ROWS=4></TEXTAREA></DIV><br/>
<DIV>Your Academic Level: <SELECT><OPTION>High School<OPTION>College Degree<OPTION>University Degree</SELECT></DIV><br/>
<DIV>Select your Topic to Subscribe:<br/><INPUT TYPE=checkbox NAME=topic VALUE=M>Multiple Choice Questions<br/>
<INPUT TYPE=checkbox NAME=topic VALUE=T>IT Tutorials<br/>
<INPUT TYPE=checkbox NAME=topic VALUE=P>Programming Guide<br/><br/>
<INPUT TYPE=submit VALUE=Submit><INPUT TYPE=reset VALUE=Reset>
</FORM>
</body>
</html>
Preview of the above HTML Code
Subscription Form
Here I have posted the HTML codes for sample only. You can customize this form according to your requirement. You can extract and use any element to create your own form.
Related Posts:
How To Create Simple Image Slideshow Using JavaScript ?
Image Slideshow with Navigation Buttons Using JavaScript
How to Create JavaScript Image Slideshow with LInks
How to Display Date Format in JavaScript?
How to Create a Digital Clock in JavaScript?
What are the Different Ways to Redirect Page in JavaScript?
How to Detect Visitors Browser Using JavaScript?
How to make rounded corners border using CSS
How to Create Custom CSS Template for Printing
How to Create Responsive Website or Blogger Template
Go to link Download
Thursday, October 20, 2016
Get better Website Advertising Earnings with Simple Tips
Get better Website Advertising Earnings with Simple Tips

The best and popular monetization way for any website or blog is advertising. This is simple and easy method is very efficient. The process involves simple copy and paste activities of the code. Stick with the key advertising networks to get satisfied earnings. Behind these advantages, some web bloggers experienced the less money making with their advertisements on the website. If the site has fewer monthly visitors, then there is no chance to boost the earning of the website via advertisements. Here is a definite set of tips to maximize the website earnings.
1. In-text advertising
For advertising purpose, most of the Website owners and bloggers rely specially on Banners ads and Adsense. Experimenting with In-Text advertising is the best way that compliments in a good manner. They are placed directly in the website, in between the article or blog post. The main advantage of this In-text advertising is the fact that its integration with the website content in a contextual format. It assists in boosting the traffic of the website and thereby increasing the website earnings. This is because, people those who might not noticed the Adsense ads will definitely observe the In-text ads. This is a vice-versa thing that enhances the profit of the website.
Infolinks, the world leader offers the best recommendation In-text advertising network. For In-text advertising, they have bounty of advertisers to work with and to offer reliable payment after you started to earn money.
2. Inventory Usage
The best online number game is making money via advertising. More the number of impressions on the banners, more the money you can make online. To maximize the earnings of the website, make sure to display the ads on the every page of the website. There are some sites that display ads on single web page, leaving other category, archive and home page. It is just like leaving in the money in the table that is of nearer distance.
3. Sell own ads as well
It is a good idea to work with established advertising network, as the process is straightforward and pretty good as well. Apart from this, any website owner can also advertise spots to the companies directly. It shuns away the need to display, Advertise with us page on the website. This is effective as some companies willingly joins to work with site owners in a straight line. It also offers them more flexibility for displaying banner type ads and positioning.
4. Multiple Tests
While advertising there will be many chances to find the optimal combination for the website, if the testing is done properly. Determine the best tool to make optimize the website and to guide through the process and provide all the necessary reports.
- To make the ad attractive and to earn high.
- Display a banner above or below the content of the post.
- Align the banner to the left or right of the website.
- Use preferable White or dark background.
Author Bio:
Eva Jasmine is a freelance marketer and a content specialist. Shes also a trainer in SEO Job Training offering digital marketing training in Chennai who loves blogging.
Go to link Download
Friday, September 30, 2016
How to Create Simple Blogger Template Easily
How to Create Simple Blogger Template Easily
To create successful blog, it needs to create blogger template more attractive and looks more professional. Even you can buy professional blogger template on the web, you may want to create blogger template by yourself for your blog. Creating a professional blogger template is more challenging task, but if you have some knowledge on HTML, XML, CSS and JavaScript, it is possible to create professional blogger template easily by yourself. In this series of tutorial, I am going to teach you basic to advanced steps to create blogger template. Today I am telling you "steps for creating a simple blogger template" with describing basic elements and along with its corresponding style sheet codes.
Step1: Preparing demo blog for creating blogger template
To test blogger template you have created, at first you need to set up a blogger blog and have to add some posts on the blog. To create a blog, go to blogger home page, log in using your Google user name and password and then click on create a blog link to get started. Write posts for a blog by clicking on create a new post button from the blogger dashboard.
Step2: Creating basic elements for blogger template
Open Notepad file write the codes according to the following format and save it as .xml extension.
# Creating XML Part
At first, add the following codes for Document Type Deceleration(DTD) on XML part.
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1 -strict.dtd">
<html expr_dir=data:blog.languageDirection ># Creating Header Part
After that, add the following header elements like head and title of the blog.<head>
<title>
<b:if cond=data:blog.pageType == "index">
<data:blog.pageTitle/>
<b:else/>
<b:if cond=data:blog.pageType != "error_page">
<data:blog.pageName/> | <data:blog.title/>
<b:else/>
Page Not Found | <data:blog.title/>
</b:if>
</b:if>
</title>
</head># Creating CSS Part
Add custom css codes for your template in the following format. The css codes must be placed inside<![CDATA[*/ and ]]>
body{
font:normal normal 14px Verdana,Geneva,sans-serif;
color:#000;padding:0 40px 40px 40px;
background:#fff;
font-size:14px;
}
#outer-wrapper{
CSS for outer-wrapper
}
#header-wrapper{
CSS for header-wrapper
}
#titlewrapper{
CSS for titlewrapper
}
#descriptionwrapper{
CSS for descriptionwrapper
}
#menuwrapper{
CSS for menuwrapper
}
#contentwrapper{
CSS for contentwrapper
}
#mainwrapper{
CSS for mainwrapper
}# Creating a Menu
To create menu for a blog, add the code in the following format. Replace URL and name of the tabs.
<div id=menuwrapper>
<ul class=FirstLevel>
<li><a href=http://www.homepage.com/ target=_self>Home
</a></li>
<li><a href=http://www.homepage.com/menu1.html target=_self>Menu1
</a></li>
<li><a href=http://www.homepage.com/menu2.html target=_self>Menu2
</a></li>
<li><a href=http://www.homepage.com/menu3.html target=_self>Menu3
</a></li>
</ul></div>
# Creating blog content
To add main blog content part, add these codes to create a widget named Blog1.<div id=outer-wrapper>
<div id=header-wrapper>
<b:section class=header id=header maxwidgets=1 showaddelement=no>
<b:widget id=HTML1 locked=true title=Header type=HTML>
</b:widget>
</b:section>
</div>
<div id=content-wrapper>
<div id=main-wrapper>
<b:section class=main id=main showaddelement=no>
<b:widget id=Blog1 locked=true title=Blog Posts type=Blog>
</b:widget>
</b:section>
</div>
</div>
</div>
Step3: Creating gadgets on sidebar and footer.
To create sidebar and footer and to add widgets for them add these code, which allows you to add widgets on sidebar and footer.
<div id=sidebar-wrapper>
<b:section class=sidebar id=sidebar showaddelement=yes>
</b:section>
</div>
<div id=footer-wrapper>
<b:section class=footer id=footer showaddelement=yes>
</b:section>
</div>
Step4: Installing blogger template on required blog.
After creating a code file on Notepad in XML format, test it on demo blog. To install prepared template, click on backup and restore button from template option on blogger dashboard. Click on download full template, the xml file will be downloaded. Then go to the required blog then go to Template Backup / Restore option and browse and upload that xml file. The template will be applied on your blog.
Related Posts:
- How To Make Simple CSS Stylesheet for a Website ?
- How To Create Simple Menu Using CSS ?
- How to validate required field in a form using javascript
- How to Display Date Format in JavaScript?
- How to Create a Digital Clock in JavaScript?
- What are the Different Ways to Redirect Page in JavaScript?
- How to Detect Visitors Browser Using JavaScript?
- Image Slideshow with Navigation Buttons Using Javascript
- How to Create Simple JavaScript Fade Effect Animation?
- Simple JavaScript Fade Effect Animation Using Jquery
Go to link Download
Subscribe to:
Posts (Atom)