Featured
-
Top 10 Template Engines for JavaScript
What is a Template engine? Template Engines are
by nishant.mishra -
jQuery Accordion
Hello readers! In this Blog we will gain knowled
by vishwanath.rana -
How to make Numbered and bulleted list in HTML Editor with JavaScript
Hello all, Working with HTML Editor we wanted t
by gaurav.gautam -
How to hide particular div with just one click?
Hi, you want a condition in which the particula
by abhishek.tiwari.458 -
How to Create and Retrieve Array in Javascript?
If you want to store multiple values in a single v
by siddharth.shahi
Tags
What Are The Use Of after() and before() Methods In JQuery
**Use Of after() and before() Methods In JQuery**
The jQuery after() method inserts content AFTER the selected HTML elements.
And
The jQuery before() method inserts content BEFORE the selected HTML elements.
**Example**
$("p").after("S...
Get current geo location from browser using html5
We can get our current geo location (latitude and Longitude.) from desktop browsers as well using html5 geolocation. We just needs to add script into our html page and it will ask you to share your location. After approve it will return you your ...
A Very Simple & Easy Javascript Form Validation
Here is a simple way to validate user name and password in an HTML form using java script.
<html>
<head>
<title>
Login page
</title>
</head>
<body>
<h1 style="font-family:Arial;text-align="center"...
Check file-size using jQuery without uploading file
A simple code snippet for checking the file-size of a file before uploading it. It will not only help to save time but also network resource as we can implement the file check at the initial point only.
The current code allows the user to sel...
Making Custom Select Box Using JQuery
While designing an HTML form, a lot of time there is a requirement of custom form elements. Below is a tutorial on how to create some nice custom select box with CSS and jQuery.
<div class="selectBox">
<div c...
Changing the Behavior of a Dialog Box with Effects
The options used when creating the dialog box can be modified by the dialog ("option", param, value) method. The param parameter is the name of the option, while the value corresponds to its new value.
lets change the effect for the opening and ...
Changing row color on clicking radio button
Consider an HTML table with multiple rows having radio button in first column of each row. Now, if we want to change the row color when radio button associated with it is clicked, we have to write following code.
// HTML //
Untitled
...
Finding the Dimensions of an Element
You want to determine the space occupied by an element.
The width and height methods can be applied to any element, and they are useful for
determining the computed width or height of an element. However, they fall short if
you need to deter...
Finding the Dimensions of the Window and Document
You want to get the width and height of the window and document in pixels.
jQuerys width and height methods provide easy access to the basic dimensions of the window or document:
$(function() {
alert('Window height:'+jQuery(window).height(...
Subtract date in JS
Subtract date in javascript : -
var current = new Date();
//It will give the current date and time in default format.
var future_date = new Date(now .setHours(now .getHours()+48));
//in this we add 48 hours in present time .
...
Adding and Removing Select Options
A drop-down box for colors and want to add new colors to it, as well as remove options from it.
<label for="colors">Colors</label>
<select id="colors" multiple="multiple">
<option>Black</options>
<option>...
Adding data to jqxtree dynimacally on click of nodes of a tree using AJAX call
There might be a case where user wants to add data to jqxtree on click of each individual node. Below is the code which help us to achieve the above
functionality where user can get data from JSON file or database on click of each individual tre...
Formatting jQuery date picker
Sometime you may need to use the jQuery calender in some project. you writes the following code:
jQuery( ".in_time" ).datepicker();
and it gives you:
1- if you need to show all the dates which are previous to the current date:
If ...
Declaring variables in jquery / javascript (for ie8)
Sometime we need to perform some operations in variables values in jquery or javascript.
We generally uses:
a = jQuery('input#marks').val();
It will be working fine in all the browsers except ie8.
This type of assignment doesn't works i...
Restricting the textbox to enter number only using thier ASCII codes
We can disable the keys to enter inside the textbox. For example if we have a textbox for entering user's age then a user only need to enter numbers (The age will only be in number format ie 12,18 and so on)
We can use the following javascript...
JScript to Check or Uncheck Checkbox in a Grid
JScript to Check or Uncheck Checkbox in a Grid
Inputs:
GridObject: Object of the grid in which checkbox exists
Column: Column name where value is searched
CellValue: Reference cell value
Status: Check or uncheck the checkbox
funct...
Selecting a text field with name using JQuery
JQuery has loads of selectors that can be used to select an HTML Element from a page.
One of the common scenario with development for even a simple case of validation requires to check for input fields and to do so we can use a selector that s...