Join the social network of Tech Nerds, increase skill rank, get work, manage projects...
 

How to select option of drop down with Jquery?

Sometimes we need select option of a drop-down dynamically by clicking on a button or on some other action. We can do this by using "selected" property. Example- In the below example I have a drop-down for distance and I want to select option ...

Draggable and resizable a block using HTML5 and Javascript

If you want your block draggable and resizable, the following code will help you for the same: HTML: <section class="map"> <div class="container-fluid"> <div class="this-week panel-group dayListing" id="ac...

How to appned li elements to ul dynamically with jQuery?

Sometimes we need to add li elements to ul dynamically based on some list. We can do this by using append() method. Example- In the below example I have a list "users" and I want to display user names dynamically on page. <html> ...

How to show div after some time period with jQuery?

Sometimes we need to display some alert or dive after some period on Web page. We can do this by using setTimeout method as below: <html> <head> <title>Demo to show div</title> <script type="...

How to hide a message after some time interval with jQuery?

Whenever we submit a form or do some task, we usually display a success message, but sometimes it is required to hide this message automatically after some time period. We can do this by two ways: By using setTimeout method: ...

How to add/remove class to an element on keyup event with jQuery?

We can add or remove a class to an element very easily by using addClass() and removeClass() methods. To do this on keyup event of a textbox we just need call these functions when we bind keyup event to textbox. Example: <input id="sear...

How to enable/disable a button with jQuery?

Sometimes we need to enable/disable a button based on some condition. We can do this easily by using "disable" attribute of a button. Example: <button type="button" id="voteButton">vote</button> To disable a button write t...

How to refresh a function after a particular time in jsp?

To refresh a function after a particular time interval to refresh the values on the page. We can do this by using setInterval() function on page load. Write the below code where refresh() function will be the function that you want to refresh...

How to focus a text box on button click in jQuery?

Sometimes we need to focus a textbox on button click based on some condition. We can do this by using focus(). Example- Suppose I want to focus search-box on button click if the search-box is empty, then we can do this as below: <input i...

How to create a basic plugin using jquery

If you want to make a functionality that can be used anywhere in the code. For example, you want some method that can be called on the jquery selection and it can perform number of operations on the selection. For this, you can write a plugin. ...

how to identify location is enable or not on browser with jQuery?

To get the user's current location use the getCurrentPosition() method. This method contains two parameters, first parameter is success for providing locationd and second one is error to handle errors for ex: getCurrentPosition(success,error) ...

How to get browser current timezone with jQuery?

Sometimes we need to identify the clients timezone to make some calculation on time. For example - we want to save current time based on user's timezone into database, so in this case we need to get the user's current timezone. To do this down...

How to detect if enter key is pressed with jQuery or not?

Sometimes we need to detect where ENTER key is pressed or not to do some action. The "enter" key is represent by code 13 (ASCII value). To detect whether ENTER key is pressed on Web-page or inside an input field, we can bind keypress() eve...

How to find the size of a file while uploading in JSP?

Sometimes we need to find the size of a file at the time of uploading to prevent the file that is greater than a particular size. We can achieve this by handling "change" event of a input-file. Examlpe: Suppose I want to upload a file less tha...

How to find the extension of a file to be uploaded in JSP?

Sometimes we need to find the extension (file-type) of a file at the time of uploading to apply some validation on it. We can do this by handling "change" event of input-file. Example: In the below example I want to upload the file having exte...

How to make HTML by using the Json Array

Hello Reader's If you having the data coming from the Json array and you need it to show in html table. Then you can perform the short Jquery action for making it automated restful service. Here the code of javascript var _table_ = docum...

Difference among bind(), live(), delegate(), on() methods in jQuery

Hello, Most of the time we have a bit of confusion between the jQuery .bind(), .live(), .delegate(), and .on() methods and when they should be used. Here I am sharing some information regarding this: bind() Method: Syntax: .bind( eventTyp...

Display image before upload using javascript/jQuery

This post demonstrates how to display an image prior to uploading it on server. This demo uses the JavaScript's readAsDataURL method of reader API which will read image as url. <html> <head> <script src="https://a...

Google Charts with Jquery Ajax

If you are working on a Google chart and need some jquery ajax requirement, then this blog is quite useful. I found this very powerful and simple to implement. Find the link at the end of details: Google Charts with Jquery Ajax If you are w...

Custom Audio Player with Jquery Audio Controls Plugin

If you are working on audio player and got stuck to manage audio controls and this jquery plugin is very useful. Find the link at the end of following details to use this plugin: Custom Audio Player with Jquery Audio Controls Plugin Introdu...

How to load header and footer using Javascript

Hello Reader's. If you have developed the header and footer of the website separatly then it's very easy to make them render on a webpage. By using the JS you can call them with a single line of code as written below:- <html> <head&g...

Finding mouse cordinate by JQuery

By using jquery event.pageX and event.pageY we find the coordinate of mouse. The PageX event shows the edges from left and the PageY event shows the edges from top. <!doctype html> <html lang="en"> <head> <meta cha...

How to upload multiple files using Jquery

Hello Reader's!. Now multiple files on a single getting in fashion so you can use any of the multiple upload library code, But here we'll see how to use Jquery and PHP to do the same For getting it start we need a html form page and it'll go ...

Display image preview before upload using jQuery

<html> <head> <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.4/jquery.min.js"></script> </head> <body> <img id="thumbnail" src="test.png" alt="Image"/> ...

How to make a redirect html page using jQuery

Redirecting a web page will occur in the header part of the page. In JQuery the page redirect have a code and it will go like this below // similar behavior as clicking on a link window.location.href = "http://findnerd.com"; As soon thi...

Fading in and out an element using jQuery

Sometimes we want an image, control or element in a page to fade in and out of visibility .With jQuery it can be done easily. Below are examples of fade in and out method for a div element: Fade In: fadeIn() method is used to fade in a hidd...

How to clear all textboxes in a form using jQuery

Hi readers ! In this blog we will see how we can clear all textboxes in a form using jQuery . To clear a textbox with id 'txtBox1' in javascript we use below code : document.getElementById('txtBox1').value = ''; We can use this cod...

How to set and get href attribute in jQuery?

Sometimes we need to set and get value of href attribute of <a> tag from jQuery. We can do this very easily by using element.attr() function in jQuery. Example: for example you declare an <a> as below: <a id="element_url" hr...

assing array to span in jquery

my response is comming in this format.... array { [0]=>abc [1]=>cde [2]=>fgh . . . . . . . . . . } I want to put this array in span.....

create object and object's combination

I need help in javascript friends I have 3 javascript array. var color = ["red", "yellow", "blue"]; var size = ["xl", "xxl", "xxxl"]; var style = ["cotton", "silk", "jins"]; and i want string like bellow line using javascript or jquery. ...

Reset or Retrieve value of all hidden type input box of FORM or DIV using jquery

Reset or Retrieve value of all hidden type input box of FORM or DIV using jQuery .each() method. You can use below code for this <!DOCTYPE html> <html> <head> <title>Reset or Retrieve value of all hidden ...

Image Crop Using Java and Jquery Crop (Jcrop)

FrontEnd: Include jquery.Jcrop.css, jquery.Jcrop.js and jquery.Jcrop.min.js Open an image in a div with a form. Take 4 hidden input fields: <input type="hidden" id="x" name="x" /> // x coordinate of the image <input type="hidde...

array in jquery

array([0]=>stdclassobject (['s_no']=1) ) is returning from ajax and i want to add this s_no's value in one textbox .....please can any one help me in jquery syntax...this is my ajax code....

How to detect and validate credit card numbers in jQuery

If you want to detect and validate credit card numbers in jquery you can use the below code. In this we use client side validation to verify the credit card type or user using valid card number. It will display the type of detected credit c...

Custom events in jquery

When we think about the jquery then first thing comes in mind that is events so today we are going to discuss the custom events. Do you know about custom events? Its name has cleared the concept, means your own events. There are so many benefits ...

Basic Tutorial of Jquery Effects Method

About JQuery jQuery is a cross-platform JavaScript library designed to simplify the client-side scripting of HTML. jQuery's syntax is de...

Jquery return false vs preventDefault

Today we are going to discuss the diffence between return false and preventDefault. We mostly use these scripts but don't know their working so let's go we first discuss the preventDefault. A) PreventDefault: it is helpful to stop the default ...

Jquery Return false, event.preventdefault and event.stopPropagation

Return False :- Basically returning false is a way to tell your action (like button click event, submit and load etc. ) is not firing. Return false do the three basic things event.preventDefault(); event.stopPropagation(); Stops the call...

How to Dynamically add element in DropDownList?

I have created a dropdownlist with the help of Jquery and javascript. In this, when we will enter the text in the field given, that value will be stored and will be added to the next list dynamically. Also We can easily remove all the items by ju...

Open Android App from Web Browser & Get Data from The App & Return Back to Web Browse

Sometime we a have a situation in which we use android app in our web application.In that situation you can use this. For opening the android app first we have to check 2 conditions . 1. If the device is android or not. 2. In the android dev...

How to use Animated AJAX Record deletion in jQuery?

With the help of jQuery we can delete link for any record. On below code we have add a click event to triggers the ajax request. when the ajax request returns get success response. $(document).ready(function() { $('a.delete').click(fu...

script for copy to clipboard

Copy to clipboard.. You can see this option in most of the blogs. You can simply click on the link and it will copy the text which set as target. Today we are going to discuss the implementation of this feature. We can see different ways to do th...

Get the device which is used by the user

Sometimes we have to write down the different scripts for different devices. Now a days most used devices are mobiles/tablets. If you want to get the device type which user is using then you need to simply add this script in your code and call th...

How to pass values from one div to another div in same page

Hello reader! If you want to send the value from one div to another div in your same webpage, you can do this by help of JavaScript function. Lets do this with example- This is the div from which the value is taken <div id='td1'>T...

Foreach loop in javascript

If we need to use foreach loop in javascript then we can use jQuery $.each() function: var data = []; data[1] = "Mike"; data[2] = "Tom"; data[5] = "Harry"; data[12] = "John"; $.each(data, function( index, value ) { alert( index + ": " ...

How to get mouse current position

According to my below code, when we will move the mouse to anywhere like left or right up and down we get the current status of the swipe. Here i have used mousemove() method . $(function() { //Enable swiping... $("#test"...

Progress bar

A Progress bar indicates the current percentage for completeness of an operation or process. jQueryUI provides an easy-to-use progress bar widget that we can use to let users know the percent of completeness of an operation. jQueryUI provides...

How can we resolve conflict between prototype and jQuery?

To resolve a conflict between jQuery and prototype, use below method jQuery.noConflict and using jQuery instead of $('code').code; jQuery.noConflict(); jQuery(function($) // $ is the jQuery object in here // and doesn't conflict ...

How to bind onclick event function in JQuery

In the example below, I have created a bind onclick event function. when we will click on the button, element will dynamically added to DOM and it will bind the click event only to the elements that exist at the time of binding. To bind the cl...

How to Create Custom Jquery Tabs

Hello Reader's In this article I will guide you how to create custom responsive tabs without use of any Jquery plugin. This will surely make your web page faster because its not an plugin. Its an simple custom Jquery HTML & css. Copy and p...
1 6 8
Sign In
                           OR                           
                           OR                           
Register

Sign up using

                           OR                           
Forgot Password
Fill out the form below and instructions to reset your password will be emailed to you:
Reset Password
Fill out the form below and reset your password: