javascript - Get all div's that doesn't have an id -


What is the most efficient method to get all the divs on that page Jquery or just vanilla js Using an ID if its more efficient I know that I can get all the divs and loop through them and can check whether they have set IDs. I am just curious if the DOM API or Jquery such There is a customized way to do it.

just do (jQuery):

  var divs = $ ( "Div: no ([id])");  

Or, as indicated by @Type well

  document.querySelectorAll ('div: not ([id])')  

Comments

Popular posts from this blog

sqlite3 - UPDATE a table from the SELECT of another one -

c# - Showing a SelectedItem's Property -

javascript - Render HTML after each iteration in loop -