D3.js | d3.selectAll() Function Last Updated : 18 Jul, 2019 Summarize Comments Improve Suggest changes Share Like Article Like Report The d3.selectAll() function in D3.js is used to select all the element that matches the specified selector string. Syntax: d3.selectAll("element") Parameters: This function accepts single parameter HTML tag as a parameter. Return Value: This function returns the selected elements. Below programs illustrate the d3.selectAll() function in D3.js: Example 1: html <!DOCTYPE html> <html> <head> <title> D3.js | d3.selectAll() Function </title> <script src = "https://d3js.org/d3.v4.min.js"></script> </head> <body> <div>Geeks</div> <div>GeeksforGeeks</div> <script> // Calling the selectAll() function d3.selectAll("div").text(); </script> </body> </html> Output: Geeks GeeksforGeeks Example 2: html <!DOCTYPE html> <html> <head> <title> D3.js | d3.selectAll() Function </title> <script src = "https://d3js.org/d3.v4.min.js"></script> </head> <body> <p>GeeksforGeeks</p> <p>A computer science portal for geeks</p> <p>d3.selectAll() function</p> <script> // Calling the selectAll() function d3.selectAll("p").text(); </script> </body> </html> Output: GeeksforGeeks A computer science portal for geeks d3.selectAll() function Reference: https://devdocs.io/d3~5/d3-selection#selectAll Comment More infoAdvertise with us Next Article D3.js | d3.set.has() Function K Kanchan_Ray Follow Improve Article Tags : JavaScript Web Technologies D3.js Similar Reads D3.js | d3.select() Function The d3.select() function in D3.js is used to select the first element that matches the specified selector string. If any element is not matched then it returns the empty selection. If multiple elements are matched with the selector then only the first matching element will be selected. Syntax: d3.se 1 min read D3.js | d3.scan() function The d3.scan() function is a built-in function in D3.js which scans the array linearly and returns the index of the minimum element according to the specified comparator. The function returns undefined when there are no comparable elements in the array. Syntax: d3.scan(array, comparator) Parameters: 2 min read D3.js selector() Function The d3.selector() function is used to return a function that returns the very first descendant of the element given as the parameter. Syntax: d3.selector(selector) Parameters: This function takes only one parameter which is given above and described below: selector: This is the string of the element 2 min read D3.js | d3.set.values() Function The set.values() function in D3.js is used to return an array of the string values in the set. This function can be used for computing the unique values for a set of strings. Syntax: d3.set([Array]).values(); Parameters: This function accepts a parameter Array of strings. Return Value: It returns th 2 min read D3.js | d3.set.has() Function The set.has() function in D3.js is used to return true if and only if the given set containing an entry for the specified value. Syntax: d3.set([Array]).has(element); Parameters: This function accepts two parameters as mentioned above and described below: Array: It store the array elements in form o 2 min read D3.js | d3.map.set() Function The map.set() function in D3.js used to set the values for the specified key string in to the created map. Syntax: d3.map.set(key, value); Parameters: This function accepts two parameters which are illustrated below: key: This is the key string. value: This is the corresponding value for each key st 2 min read Like