Kristi Castro has Published 104 Articles

How to center a div on the screen using jQuery?

Kristi Castro

Kristi Castro

Updated on 20-Jun-2020 08:05:51

534 Views

To center a div on the screen, use the jQuery centering function jQuery.fn.center. You can try to run the following code to learn how to center a div on the screen:ExampleLive Demo               $(document).ready(function(){       jQuery.fn.center = function(parent) ... Read More

How to count number of columns in a table with jQuery

Kristi Castro

Kristi Castro

Updated on 20-Jun-2020 08:04:48

561 Views

To count number of columns in a table with jQuery, use the each() function with attr(). You can try to run the following code to learn how to count column in a table:EaxmpleLive Demo       jQuery Example             $(document).ready(function(){   ... Read More

How can I tell if table row is in view using jQuery?

Kristi Castro

Kristi Castro

Updated on 20-Jun-2020 08:03:51

830 Views

To check if table row exists or not, use the is() method, with the :visible selector −if($(".row").is(":visible")) {   alert("Visible!"); }You can try to run the following code to learn how to chck if a row exists or not. It even notifies when a new row is created −ExampleLive Demo ... Read More

How to call a jQuery function after a certain delay?

Kristi Castro

Kristi Castro

Updated on 20-Jun-2020 08:02:01

5K+ Views

To call a jQuery function after a certain delay, use the siteTimeout() method. Here, jQuery fadeOut() function is called after some seconds.You can try to run the following code to learn how to work with setTimeout() method in jQuery to call a jQuery function after a delay −ExampleLive Demo ... Read More

How to know which key was pressed in a form input using jQuery?

Kristi Castro

Kristi Castro

Updated on 20-Jun-2020 07:48:16

278 Views

To know which key was pressed in a form input using jQuery, use the jQuery keydown event. You can try to run the following code to learn how to detect key pressed in a form input −ExampleLive Demo               $(document).ready(function(){ ... Read More

How to detect pressing Enter on keyboard using jQuery?

Kristi Castro

Kristi Castro

Updated on 20-Jun-2020 07:46:52

276 Views

To detect pressing Enter on keyboard, use the keup() function with keyCode. You can try to run the following code to learn how to detect pressing Enter on keyboard using jQuery −ExampleLive Demo                          $(document).ready(function(){     ... Read More

How to validate email using jQuery?

Kristi Castro

Kristi Castro

Updated on 20-Jun-2020 07:36:39

10K+ Views

To validate email using jQuery, use the regex pattern. You can try to run the following code to learn how to validate email using jQuery −ExampleLive Demo               $(document).ready(function() {       $('.error').hide();       $('#submit').click(function(){     ... Read More

How to select ALL children (in any level) from a parent in jQuery?

Kristi Castro

Kristi Castro

Updated on 20-Jun-2020 07:35:38

731 Views

To select all children from a parent in jQuery, use the find() method. You can try to run the following code to select ALL children in any level −ExampleLive Demo        .myclass * {      display: block;      border: 2px solid lightgrey;   ... Read More

Why do we use JSON.stringify() method in jQuery?

Kristi Castro

Kristi Castro

Updated on 20-Jun-2020 07:32:07

409 Views

JSON or JavaScript Object Notation is a lightweight text-based open standard designed for human-readable data interchange. Use the JSON.stringify() method to convert a JavaScript object into a string.You can try to run the following code to learn how to work with JSON.stringify() method −ExampleLive Demo JSON string ... Read More

How to increase the duration of jQuery effects?

Kristi Castro

Kristi Castro

Updated on 20-Jun-2020 07:31:03

213 Views

To increase the duration of jQuery effects, set the optional speed parameter. The values include, slow, fast, milliseconds, etc. The fast value is used to increase the duration.Let us see an example with fadeIn() jQuery method. The fadeIn( ) method fades in all matched elements by adjusting their opacity and ... Read More

Previous 1 ... 4 5 6 7 8 ... 11 Next
Advertisements