script (HTML4 & HTML5)

Specifies that the enclosed content is a client-side script.

Properties & Events

KeyDescriptionAvailability
charsetSpecifies the character set associated with the element.
chrome 1.0safari 1.0Firefox 1.0ie 2.0opera 4.0
deferIf present, specifies that execution of the element is deferred.
chrome 1.0safari 1.0Firefox 1.0ie 3.0opera 7.0
forId corresponding to the form or event associated with the element.
chrome 1.0safari 1.0Firefox 1.0ie 4.0opera ??
idUnique identifier for the element.
chrome 1.0safari 1.0Firefox 1.0ie 1.0opera 1.0
languageSpecifies the scripting language.
chrome 1.0safari 1.0Firefox 1.0ie 3.0opera 4.0
srcURL for the source for the element.
chrome 1.0safari 1.0Firefox 1.0ie 2.0opera 1.0
typeSpecifies the type of script.
chrome 1.0safari 1.0Firefox 1.0ie 3.0opera 4.0
onloadFires when the content of the element finishes loading.
chrome 1.0safari 1.0Firefox 1.0ie 2.0opera 4.0

Examples having uses of: 'script'

2 votes
15k views

JavaScript Prompt Object

Prompt box used for taking input from user. If you click on ok button then it return input value else it return null
1 votes
12k views

jQuery AJAX Introduction

The jQuery load method is a simple to use AJAX (Asynchronous JavaScript and XML.) function. That enables you to load ajax content with one line of code. AJAX is a technique for creating better and more interactive web applications and we at webgrid.com are using ajax with jQuery alot to make this web page better!
9 votes
12k views

JavaScript Introduction

JavaScript is a client side scripting language that can make your webpage intaractive and JavaScript can be embbeded into your static HTML webpage directly.
2 votes
11k views

jQuery - Get CSS information

Using the css property we can get the simple CSS property value of an attribute.
1 votes
11k views

jQuery Plugin Introduction

By extending jQuery, you create reusable components that can be used on any web page. Your code is encapsulated and there is less risk that you will use the same function names elsewhere.
3 votes
11k views

HTML JavaScript

A JavaScript can be a small, embedded program that can add interactivity to your website. For example, a script could generate a pop-up alert box message.
1 votes
10k views

HTML5 Drag and Drop

Now HTML 5 came up with a Drag and Drop (DnD) API that brings native DnD support to the browser making it much easier to code up. HTML 5 DnD is supported by all the major browsers like Chrome, Firefox 3.5 and Safari.
4 votes
10k views

jQuery Hide & Show

With jQuery, you can hide and show HTML elements with the hide and show methods
1 votes
10k views

HTML5 canvas

The <canvas> tag is used to draw graphics, on the fly, via scripting (usually JavaScript). The <canvas> tag is only a container for graphics, you must use a script to actually draw the graphics.
1 votes
10k views

jQuery Selectors Basics

jQuery selectors allows us to select HTML elements and manipute them as a group or as a single object. In jQuery it's common that selectors start with dollar sign and parentheses. Syntax:- $.(selector).methodName();
3 votes
10k views

jQuery DOM Traversing

jQuery is a very powerful tool which provides a variety of traversal methods to help us select elements in a document randomly as well as in sequential method. In other words, we can say that most of the traversing methods are used to find elements from the documents.
0 votes
10k views

JavaScript Click and Mouse Events

Javascript Events are the actions which are detected by the javascript when they are fired.
4 votes
10k views

HTML5 geoLocation

The HTML5 Geolocation API is used to get the geographical position of a user. NOTE: Since this can compromise user privacy, the position is not available unless the user approves it.
3 votes
10k views

jQuery Introduction

jQuery is a cross-browser JavaScript library designed to simplify the client-side scripting of HTML. jQuery is an open source JavaScript library that simplifies the interactions between an HTML document, or more precisely the Document Object Model (DOM), and JavaScript.
2 votes
10k views

jQuery Animate Introduction

jQuery animate method is very powerful API to manipulate html elements and add animation functionality. The use of animate function is very simple.
1 votes
9k views

HTML Script

The <script> tag is used to define a client-side script, such as a JavaScript. The script element either contains scripting statements or it points to an external script file through the src attribute.
0 votes
9k views

jQuery Support

jQuery.support is a collection of properties that represent the presence of different browser features or bugs. Primarily intended for jQuery's internal use; specific properties may be removed when they are no longer needed internally to improve page startup performance.
1 votes
9k views

jQuery Event Introduction

Introduction to jQuery and how to attach a handler to one or more events for all elements that match the selector.
1 votes
9k views

JavaScript setTimeout function

JavaScript setTimeout function provides the functionality to execute the specified function after the sepcified number of milliseconds. Using the JavaScript setTimeout function you can set the delay before function execution.
0 votes
9k views

JavaScript setTimeout and clearTimeout

JavaScript clearTimeout function enables you to stop the timer event started by the JavaScript setTimeout function. When you apply the setTimeout function using a recursive loop over the JavaScript function by specifying the time delay then it calls the function continuously after equal intervals of time.
3 votes
9k views

jQuery Attributes

Some of the most basic components we can manipulate when it comes to DOM elements are the properties and attributes assigned to those elements
1 votes
9k views

Create JavaScript Cookie

Cookies are stored by the web browser. They allow you to store particular information about a user and retrieve it every time they visit your pages. Each user has their own unique set of cookies
0 votes
9k views

JavaScript switch statement with number

The switch statement is used to select one statement from the many blocks. This is used on place of nested if…else. If there are number of if..else statements then we should use switch.
3 votes
9k views

jQuery Basic Manipulation

jQuery provides methods to manipulate documents in efficient way. You do not need to write big code to modify the value of any element's attribute or to extract HTML code from a paragraph or division.
1 votes
8k views

JavaScript Statement introduction

JavaScript statement is a command that tells a browser to tell what to do. JavaScript statements is a instruction to browser and the statements are executed sequentially.
1 votes
8k views

jQuery AJAX Life Cycle

jQuery AJAX life cycle demonstration. This is a demonstration of the methods ajaxStart, ajaxSend, ajaxComplete, ajaxStop, and ajaxSuccess that are triggered when load method is called.
2 votes
8k views

JavaScript Required Validation

JavaScript validation are client side scrips that is used to reduce the server load because all validation are check on client browser. This example has a required validation on the input box.
2 votes
8k views

JavaScript function Introduction

A function in Javascript is a group of statement that is executed when it's triggered. A function can be called from anywhere within the page. As it is the part of javascript it is defined under the <script> tag.
1 votes
8k views

JavaScript Comparison Operator ==

JavaScript "==" is equal to operator.
0 votes
8k views

JavaScript Variable Introduction

Javascript variables is a key to an object of data. Variable is defined using 'var' keyword and JavaScript variables are case sensetive, so 'key' and 'Key' are two different variables.
3 votes
8k views

JavaScript if and else

JavaScript if…else is a conditional statement that is used to check wether a condition is true or false to take a decision.
4 votes
8k views

jQuery ajaxStart & ajaxComplete

jQuery ajaxStart and ajaxComplete are two functions are very useful to show the graphics while the data is loading from server. The ajaxStart method works while the server fullfilling the service asked to it. The ajaxComplete method is called when the server fulfilled the request.
1 votes
8k views

JavaScript Arithmetic Operators

Arithmatic operators are used to perform operations on the numbers.
0 votes
8k views

Javascript Guidelines

There are some guidelines which must be remembered while coding in javascript. 1) Javascript is case-sensitive language. 2) JavaScript ignores extra white spaces. 3) You can break the line of code.
1 votes
7k views

JavaScript Object Introduction

An object is an entity which can have properties, events and methods. This example creates a simple string holding the text 'hello world'. Some Standard Objects that are part of the JavaScript are 'String','Date','Array','Boolean','Array','Math' and 'RegExp'.
1 votes
7k views

JavaScript For

Javascripts loops are similar to other programming languages. Loops allows us to execute a block of statements to the specified number of times.
1 votes
7k views

JavaScript Try and Catch

Javascript Try…catch statement to check if there is errors in a block of code.
0 votes
3k views

HTML5 Drag and Drop between four elements

Drag and Drop magic with HTML5 using an image to drag back and forth between four <div> elements.
2 votes
3k views

JavaScript onLoad and Unload Events

These events are fired when a web page is loaded to browser and when user leaves the page.
0 votes
2k views

jQuery Toggle

The jQuery toggle method toggles the visibility of HTML elements using the show or hide methods. Shown elements are hidden and hidden elements are shown. The speed parameter can take the following values: "slow", "fast", "normal", or milliseconds.
0 votes
2k views

JavaScript onselect Event

Triggers whenever you Select/Highlight some text within textbox or textarea.
0 votes
2k views

JavaScript clearInterval method

JavaScript clearInterval function enables you to stop the timer event started by the JavaScript setIntterval function. When you apply the setInterval function a JavaScript function by specifying the time interval then it calls the function continuously after equal intervals of time.
1 votes
2k views

HTML5 Canvas Image

The drawImage method allows you to insert other images (img and canvas elements) into your canvas context. To draw an image using HTML5 Canvas, we can use the drawImage() method which requires an image object and a destination point. The destination point is relative to the top left corner of the image.
0 votes
2k views

jQuery - Multiple CSS properties

jQuery allows to change the multiple CSS properties value at once.
1 votes
2k views

jQuery Focus & Change Event

jQuery events can be used to register behaviors to take effect when the user interacts with the browser, and to further manipulate those registered behaviors.
1 votes
2k views

JavaScript Numeric Validation

JavaScript validation are client side scrips that is used to reduce the server load because all validation are check on client browser. This example validates numeric characters on the input.
0 votes
2k views

HTML5 Canvas Text

To align HTML5 Canvas text, we can use the textAlign property of the canvas context, which can be set to start, end, left, center, or right. Unless otherwise specified, the textAlign property is defaulted to left.
0 votes
2k views

jQuery DOM Traversing and locating elements

Jquery traversing methods can be used to locate all the descendent elements of a particular type of elements.
0 votes
1k views

JavaScript Keyboard Events

This event are fired when a key is pressed. IE 8 and earlier use event.keyCode to retrieve the key that was pressed down, while Firefox/Chrome/Safari/Opera use event.which.
0 votes
1k views

JavaScript setInterval function

JavaScript setInterval function provides the functionality to execute the specified function after the sepcified time interval in milliseconds. Using the JavaScript setInterval function you can set the time interval to call a function again and again.
0 votes
1k views

JavaScript Try and Catch inside a function

Javascript Try…catch statement to check if there is errors in a block of code.
0 votes
1k views

JavaScript setTimeout method

Here in a text box the timer is display on "start count" button click and stop on "start count " click
1 votes
1k views

Javascript Email Address Validation

JavaScript validation are client side scrips that is used to reduce the server load because all validation are check on client browser. This example validates the input matches a valid e-mail address with a regular expression.
2 votes
1k views

jQuery Slide

The jQuery slideUp and slideDown methods gradually change the height of the selected elements.
1 votes
1k views

jQuery Selectors Advanced

The jQuery nth-child is used to select all elements that are ntg-child of of their parent. The nth-child(n) is “1-indexed”, meaning the “n” is counting starts at 1. Because jQuery's implementation of :nth-child(n) is strictly derived from the CSS specification, the value of n is "1-indexed", meaning that the counting starts at 1. For all other selector expressions, however, jQuery follows JavaScript's "0-indexed" counting.
1 votes
1k views

HTML5 canvas 2D

HTML5 canvas populated with one filled rectangle and one painted stroke.
0 votes
1k views

JavaScript Alphabetic Character Validation

JavaScript validation are client side scrips that is used to reduce the server load because all validation are check on client browser. This example validates alphabetic characters on the input
0 votes
1k views

JavaScript window Object

Create a new window and move new browser window.
1 votes
1k views

HTML Script

HTML script tag is used to define an section with javascript. In our example we have created two javascript function in the header. Note that each link shows a different way of calling the function.
0 votes
1k views

jQuery Mouse Event

jQuery mouse events are events that have to do with actions of the mouse. These can be a click, double-click, mouse down and more. Mouse events can be used in two different ways.
0 votes
1k views

jQuery Replace Element

Using jquery manipulation methods, we can replace elements with another elements.
0 votes
1k views

jQuery Fade

The jQuery fade methods gradually change the opacity for selected elements.
0 votes
1k views

jQuery Error handling

Register a handler with jQuery to be called when Ajax requests complete with an error. Whenever an Ajax request completes with an error, jQuery triggers the ajaxError event. Any and all handlers that have been registered with the .ajaxError() method are executed at this time.
0 votes
1k views

jQuery Create Element

jQuery provides methods to manipulate documents in efficient way. Using jquery manipulation methods, we can insert element in given document. Like here we add a new element before the blue square.
1 votes
1k views

jQuery User Controlled Animation

jQuery Animate can function supports animation in different directions
0 votes
1k views

JavaScript switch statement with string

The switch statement is used to select one statement from the many blocks. This is used on place of nested if…else. If there are number of if..else statements then we should use switch.
0 votes
1k views

HTML Noscript

he <noscript> tag is used to provide an alternate content for users that have disabled scripts in their browser or have a browser that doesn’t support client-side scripting. The noscript element can contain all the elements that you can find inside the body element of a normal HTML page. The content inside the noscript element will only be displayed if scripts are not supported, or are disabled in the user’s browser:
1 votes
1k views

jQuery Browser Detection

jQuery.browser contains flags for the useragent, read from navigator.userAgent. We recommend against using this property; please try to use feature detection instead (see jQuery.support). jQuery.browser may be moved to a plugin in a future release of jQuery.
0 votes
1k views

jQuery Animate

The jQuery animate method has a complete method we can supply with callback function that is fired once the animation is complete. This can be useful for stringing different animations together in sequence like this example.
0 votes
1k views

JQuery Syntax

With jQuery you select (query) HTML elements and perform "actions" on them. The jQuery syntax is tailor made for selecting HTML elements and perform some action on the element(s) or attributes to element(s)
1 votes
1k views

JavaScript onfocus Event

JavaScript event that triggers when object gets focus.
0 votes
1k views

JavaScript function with arguments

A function can take arguments whenever it is called. When arguments are passed on calling of function, the fuction is called 'function with arguments'. When a funtion does not take any argument function is called 'function without argument'. A function can return a value using the keyword 'return'.
0 votes
1k views

JavaScript iframe height

The Frame and Iframe represents html frame and iframe respectively.This DOM object has all the properties that a HTML element has. We can change these properties using javascript.
2 votes
1k views

JavaScript screen object

screen object gives your browser screen information like width,height,color depth.
0 votes
1k views

JavaScript Print method

Opens a dialog window for printing the current web page.
0 votes
1k views

JavaScript Random

JavaScript random method returns a random number between 0 and 1.
0 votes
1k views

jQuery Animate Properties

jQuery animate also support different properties and multiple unit types within one animation.
1 votes
1k views

jQuery Remove Element

Using jQuery manipulation methods, we can remove elements.
0 votes
1k views

JavaScript nested if and else

This statement allows us to select one statement among many statements.It is also called nested if….else.
0 votes
1k views

Complete Web Page Example

The HTML head Element The head element is a container for all the head elements. Elements inside <head> can include scripts, instruct the browser where to find style sheets, provide meta information, and more. The following tags can be added to the head section: <title>, <base>, <link>, <meta>, <script>, and <style>.
0 votes
1k views

JavaScript Logical Operators

JavaScript logical operators are used to determine the logic between variables and values.
0 votes
1k views

JavaScript Loop with break and continue

Javascript provides us the facility to break a loop in middle and also to continue the loop without executing the whole body of the loop.There are two keywords that provides these facilities: 1) break 2) continue
1 votes
1k views

jQuery Element manipulation

jQuery contains powerful methods (functions) for changing and manipulating HTML elements and attributes. Click on the button to see jQuery hiding the paragraphs.
1 votes
1k views

How to use JavaScript

JavaScript can be written at any place in the page or can be in external file. JavaScript is written in the head section in <script> tag.
0 votes
1k views

JavaScript Submit Event

This event is fired when the form is submitted. This is only works with the form element of the HTML.
0 votes
1k views

jQuery DOM Traversing and filtering

Most of the JQuery Traversal Methods do not modify the jQuery object and they are used to filter out elements from a document based on given conditions. The filter( selector ) method can be used to filter out all elements from the set of matched elements that do not match the specified selector(s).
0 votes
1k views

jQuery - Set CSS for an element

jQuery also allows us the set the property value of the CSS.
0 votes
1k views

JavaScript Browser Detection

The Navigator object contains information about the visitor's browser.
0 votes
1k views

JavaScript DOM Attribute count

Count number of attributes that exists for the button.
0 votes
1k views

JavaScript Do While

Do…While loop is the varient of the while loop. The difference between while and do…while is that while loop only executes if the condition is true while do….while loop executes atleast once even the codition is false.
0 votes
1k views

JavaScript Generating HTML and Text

make your HTML pages become more dynamic and interactive by using JavaScript
0 votes
1k views

JavaScript DOM setAttribute

We are here using Core DOM setAttribute method we set the value of input type text to button.
0 votes
1k views

JavaScript Loading Order

The HTML paragraph element is written on the web page before the dynamic content from the script. That is because the script tag is after the paragraph tag. If you move the HTML script element to the "head" tag you will see the dynamic text is written first!
0 votes
1k views

JavaScript anonymous setTimeout function

Example how to call anonymous function on setTimeout function.
0 votes
1k views

JavaScript Link Object

The link object is used to include the external file in the web page. This tag must be inside the head tag of the page. Here is the example of the link that give the type of the external sheet.
1 votes
1k views

jQuery Selectors Types

jQuery selectors allow you to select and manipulate HTML elements as a group or as a single element.
0 votes
1k views

JavaScript Math Object

A javascript Math object allows us to perform the mathematical tasks.
0 votes
1k views

JavaScript Keywords example

A small example displaying the usage of two JavaScript keywords in a code block.
0 votes
1k views

JavaScript Date Object

The Date object is used to work with dates and times.
0 votes
1k views

JavaScript function with return value

If you provide a return statement inside a function you may specify the value that you would like to return from the function. So, functions that are going to return a value must use the return statement.
0 votes
1k views

Delete JavaScript Cookie

Enables you to remove a client cookie with JavaScript. We remove the cookie by setting the expiration date for the cookie back in time.
0 votes
1k views

Minimise inline JavaScript

Almost all JavaScript code should be in separate JavaScript files. There should be the smallest possible amount of JavaScript inline in the HTML code of pages.
0 votes
1k views

JavaScript RegExp Object

JavaScript regular expression can be used to maniplate strings and perform text searches. In this example we do a case-insensitive search for "www.webgrid.com" in a string.
0 votes
1k views

JavaScript Comparison Operator <

JavaScript < is less then operator.
0 votes
1k views

JavaScript Array Object

Javascript array is used to store multiple values in a variable.
0 votes
1k views

JavaScript variables local and global

If a variable is defined in a function then it will be local for this function, it can not be used outside of that function. A variable which is defined outside of the fuction becomes Global and this variable can be used in whole webpage document.
0 votes
1k views

When JavaScript is not supported

While most current browsers understand Javascript a lot of the early browsers did not. The current browsers also allow Javascript to be turned off and some people do this. What this means is that not all of the visitors to your page will see the effects of the JavaScript on your page. We need to make sure that these visitors can use our site even without JavaScript.
0 votes
1k views

JavaScript Comparison Operator !=

JavaScript "==" is not equal to operator.
0 votes
1k views

JavaScript statement code blocks

JavaScript code are the sequence of statements.These statements can be grouped. These grouped are called blocks and the blocks are created using {} brackets.
0 votes
1k views

JavaScript While

As 'for loop' executes the specified number of times, the while loop executes while a condition is true.
0 votes
1k views

JavaScript String Object

The String object is used to manipulate texts.
0 votes
1k views

JavaScript Boolean Object

The Boolean object is used to convert a non-Boolean value to a Boolean value (true or false).
0 votes
1k views

JavaScript has a flexible variable type

The flexible nature of JavaScript variable types can lead to confusion as to the particular type of a variable at any given time in a script. To address this concern JavaScript provides the typeof operator. The typeof operator returns the current variable type of the specified variable.
0 votes
1k views

JavaScript Comparison Operator ===

JavaScript "===" is exactly equal to (value and type) operator.
0 votes
1k views

Minimise the number of JavaScript files

Try not to use too many different JavaScript files. Each separate file that the browser has to load incurs an overhead. You may consider to merge and minimise JavaScript files before you publish your website. This to reduce the bandwidth usage and lower webpage load time.
0 votes
1k views

JavaScript Comparision Operators

Comparision Operators are used to compare the values of the variables, and the result is used to make the decision.
0 votes
1k views

Javascript Assignment Operators

Javascript assignment operators are used to assign values.There 6 assignment operators that can be used.
0 votes
1k views

JavaScript Comparison Operator >=

JavaScript > is greater or equal to operator.
0 votes
1k views

JavaScript Comparison Operator <=

JavaScript > is less or equal to operator.
0 votes
1k views

JavaScript Comparison Operator >

JavaScript > is greater then operator.
0 votes
1k views

JavaScript Logical Operator || (or)

The || (or operator) logical operator are used to determine the logic between variables or values.
0 votes
1k views

JavaScript Logical Operator && (and)

The && (and operator) logical operator are used to determine the logic between variables or values.
0 votes
1k views

JavaScript Logical Operator ! (not)

The ! (not operator) logical operator are used to determine the logic between variables or values.