Article Categories
- All Categories
-
Data Structure
-
Networking
-
RDBMS
-
Operating System
-
Java
-
MS Excel
-
iOS
-
HTML
-
CSS
-
Android
-
Python
-
C Programming
-
C++
-
C#
-
MongoDB
-
MySQL
-
Javascript
-
PHP
Articles on Trending Technologies
Technical articles with clear explanations and examples
How to break a loop in JavaScript?
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 MoreWhat is the difference between jQuery.map() and jQuery.each() Functions in jQuery?
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 MoreHow to add the previous element to current jQuery selection?
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 MoreWhat is the difference between jQuery.children( ) and jQuery.siblings( ) in jQuery?
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 MoreWhat do you understand by jQuery Traversing Siblings?
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 MoreWhich one is the fastest between children() and find() in jQuery?
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 MoreHow to find the vowels in a given string using Java?
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 MoreHow to get the POST values from serializeArray in PHP?
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 MoreHow to find consonants in a given string using Java?
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 MoreHow to extract the first n characters from a string using Java?
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