AllInWorld99 provides a reference manual covering many aspects of web programming, including technologies such as HTML, XHTML, CSS, XML, JavaScript, PHP, ASP, SQL,FLASH, jQuery, java, for loop, switch case, if, if else, for...of, for...in, for...each,while loop, blogger tips, blogger meta tag generator, blogger tricks, blogger pagination, client side script, html code editor, javascript editor with instant output, css editor, online html editor, materialize css tutorial, materialize css dropdown list,break, continue statement, label,array, json, get day and month dropdown list using c# code, CSS button,protect cd or pendrive from virus, cordova, android example, html and css to make android app, html code play,telerik show hide column, Transparent image convertor, copy to clipboard using javascript without using any swf file, simple animation using css, SQL etc. AllInWorld99 presents thousands of code examples (accompanied with source code) which can be copied/downloaded independantly. By using the online editor provided,readers can edit the examples and execute the code experimentally.


Simple Addition Program Using jQuery
     In the following example is the very simplest addition program using jQuery, jQuery is the framework of javascript, jQuery is the plugin created using pure javascript code. The jQuery can easy to do to program.

     First we need to create three text boxes one for first number second one for second number and thired for show the sum of two numbers.

Sum of two number jQuery
Creating text box
     The text box is the basic element in html, it is very simple to remember and create.

syntax

<input type="text">
     The input type having many attributes, the one of the important attribute is id , it is used for accessing the textbox value from javascript/jQuery code.

Example

<input type="text" id="txt1">

     The id is unique, all html element should have different unique id value.


<input type="text" id="txt1">

<input type="text" id="txt2">

<input type="text" id="txt3">

Creating the button
     The button also one of the very important html element, it can do some action while clicking or other action.

syntax

<input type="text" value="Sample button" onclick="call_fun();">

     onclick is one of the event, it indicate when the user click on the "Sample button" button the call_fun() will call.

Get the textbox value using javascript
     First we need to access the textbox value, so we have a method for get the text box value using javascript

Syntax

document.getElementById("id").value;

Example

var tvalue=document.getElementById("txt1").value;

Empty the textbox value using javascript
     We can access and it using elements id, same as the way is clear the textbox value.
Example

document.getElementById("txt1").value="";



Example Program:- (Editor)


Editor is Loading...

Advertisement

0 comments:

Post a Comment

Total Pageviews