Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

get elements by class name wildcard

var elements = document.getElementsByClassName( /* class names other than aid_* ones */
var re = new RegExp('(^|s)aid_(s|$)'); 
var result = [];

for (var i=0, iLen=elements.length; i<iLen; i++) {
  if (re.test(elements[i].className)) {
    result.push(elements[i]);
  }
}
Comment

PREVIOUS NEXT
Code Example
Javascript :: cargar un select con javascript dependiendo de otro select 
Javascript :: how to choose a weighted random array element in javascript 
Javascript :: Get index of child elements with event listener in JavaScript 
Javascript :: how to run javascript in terminal 
Javascript :: react native geolocation 
Javascript :: this javascript 
Javascript :: javascript every nested array 
Javascript :: js object filter by keys 
Javascript :: js includes case insensitive 
Javascript :: js brightness 
Javascript :: array sort 
Javascript :: javascript string return character 
Javascript :: Remove escape characters from JSON Data 
Javascript :: setimmediate node example 
Javascript :: multer 
Javascript :: pass infinite argument in function 
Javascript :: change css variable with javascript 
Javascript :: react-native spinner 
Javascript :: reach last array js 
Javascript :: sub function javascript 
Javascript :: javascript return data async 
Javascript :: for in loops javascript 
Javascript :: get subdomain from url javascript 
Javascript :: jquery edit href 
Javascript :: socket io get user rooms 
Javascript :: how to break from map in javascript 
Javascript :: javascript async await returns undefined 
Javascript :: how can we access the data from array object in javascript 
Javascript :: find element and find elements 
Javascript :: axios download file from url 
ADD CONTENT
Topic
Content
Source link
Name
3+2 =