onclick event for label (HTML4 & HTML5)

Fires when the element is clicked.

Result from the Online TryIt-Editor
chrome 1.0safari 1.0Firefox 1.0ie 4.0opera 5.0

Browser Support

Examples having uses of html event 'onclick'

2 votes
16k 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
0 votes
12k views

URL Encoding

In JavaScript there are functions that can be used to URL encode a string. In JavaScript you can use the encodeURI function
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.
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.
1 votes
10k 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 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.
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.
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.
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.
1 votes
8k 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.
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

Html Input Form

Example form using <legend> and <fieldset> to make the form layout fancy.
0 votes
2k 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
2k views

HTML Element with JavaScript code

<a> tag has a "onclick" event that is triggered when clicked. This is a good place to use JavaScript to build nire interactivity into your web page.
0 votes
2k views

JavaScript setTimeout method

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

CSS Display block

CSS display block property displays the HTML elements in the block.
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

JavaScript window Object

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

CSS Pseudo

CSS pseudo-classes are used to add special effects to some selectors.
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

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.
0 votes
1k views

JavaScript Print method

Opens a dialog window for printing the current web page.
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
0 votes
1k views

JavaScript Random

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

JavaScript DOM Attribute count

Count number of attributes that exists for the button.
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

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 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 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.