Articles on Trending Technologies

Technical articles with clear explanations and examples

How to break a loop in JavaScript?

Ankitha Reddy
Ankitha Reddy
Updated on 11-Mar-2026 446 Views

The break statement is used to break a loop and continue executing the code, which is after the loop.ExampleYou can try to run the following code to break a loop in JavaScript                          var text = "";          var i;          for (i = 0; i < 5; i++) {             if (i === 2) {                break;             }             text += "Value: " + i + "";          }          document.getElementById("test").innerHTML = text;           OutputValue: 0 Value: 1

Read More

What is the difference between jQuery.map() and jQuery.each() Functions in jQuery?

David Meador
David Meador
Updated on 11-Mar-2026 423 Views

jQuery map functionThe map method translates a set of elements in the jQuery object into another set of values in a jQuery array which may, or may not contain elements.ExampleYou can try to run the following code to learn how to work with jQuery.map() method:           jQuery Map Method                              $(document).ready(function(){                         var mappedItems = $("li").map(function (index) {                var replacement = $("").text($(this).text()).get(0); ...

Read More

How to add the previous element to current jQuery selection?

David Meador
David Meador
Updated on 11-Mar-2026 652 Views

To add the previous element to current jQuery selection, use the insertBefore() method.ExampleYou can try to run the following code to learn how to work with insertBefore() method: $(document).ready(function(){     $("button").click(function(){         $("Demo text").insertBefore("p");     }); }); Insert This is a paragraph.

Read More

What is the difference between jQuery.children( ) and jQuery.siblings( ) in jQuery?

David Meador
David Meador
Updated on 11-Mar-2026 475 Views

jQuery children() methodThe children( [selector] ) method gets a set of elements containing all of the unique immediate children of each of the matched set of elements.Here is the description of all the parameters used by this method −selector − This is an optional argument to filter out all the childrens. If not supplied then all the childrens are selected.ExampleYou can try to run the following code to learn how to work with jQuery children() method:           jQuery children() method                          $(document).ready(function(){     ...

Read More

What do you understand by jQuery Traversing Siblings?

David Meador
David Meador
Updated on 11-Mar-2026 178 Views

jQuery traversing siblings  is traverse to find siblings of an elements using jQuery. To traverse sideways in DOM tree, use the following methods:siblings(): This returns all the siblings elements of the selected element.next(): This method returns the next sibling element of the selected element.nextAll(): This method returns all next sibling element of the selected element.nextUntil(): The nextUntil() method returns all next sibling elements between two given arguments.prev():This method returns the previous sibling element of the selected element.prevAll(): This method returns all previous sibling element of the selected elementprevUntil():The prevUntil() method returns all next previous sibling elements between two given arguments.Let’s ...

Read More

Which one is the fastest between children() and find() in jQuery?

Amit D
Amit D
Updated on 11-Mar-2026 542 Views

The answer to which one is the fastest between children() and find() method depends on the usage. The find() method traverses the entire Dom whereas the children() method gets the immediate children of the node.jQuery children() methodThe children() method is to get the immediate children of the node. The children( [selector] ) method gets a set of elements containing all of the unique immediate children of each of the matched set of elements.Here is the description of all the parameters used by this method −selector − This is an optional argument to filter out all the childrens. If not supplied then ...

Read More

How to find the vowels in a given string using Java?

Arushi
Arushi
Updated on 11-Mar-2026 39K+ Views

You can read a character in a String using the charAt() method. To find the vowels in a given String you need to compare every character in it with the vowel letters. Example public class FindingVowels {    public static void main(String args[]) {       String str = new String("Hi Welcome to Tutorialspoint");       for(int i=0; i

Read More

How to get the POST values from serializeArray in PHP?

Ricky Barnes
Ricky Barnes
Updated on 11-Mar-2026 3K+ Views

To get the POST values from serializeArray in PHP, use the serializeArray() method. The serializeArray( ) method serializes all forms and form elements like the .serialize() method but returns a JSON data structure for you to work with.Let’s say we have the PHP content in serialize.php file:ExampleThe following is an example showing the usage of this method:           The jQuery Example                              $(document).ready(function() {                         $("#driver").click(function(event){       ...

Read More

How to find consonants in a given string using Java?

George John
George John
Updated on 11-Mar-2026 4K+ Views

One way to find the vowels in a given String is to compare every character in it using the charAt() method with the vowel letters. Example public class FindingConsonants { public static void main(String args[]) { String str = new String("Hi Welcome to Tutorialspoint"); for(int i=0; i

Read More

How to extract the first n characters from a string using Java?

Rishi Raj
Rishi Raj
Updated on 11-Mar-2026 942 Views

To find the consonants in the given String compare every character in it using the charAt() method with the vowel letters and remaining are consonants.Examplepublic class FindingConsonants {    public static void main(String args[]) {       String str = new String("Hi Welcome to Tutorialspoint");       for(int i=0; i

Read More
Showing 291–300 of 61,248 articles
« Prev 1 28 29 30 31 32 6125 Next »
Advertisements