To select a DOM (Document Object Model) element with JavaScript, you can use several methods, here are few of them:
1. `document.getElementById(id)`: This method returns the element that has the ID attribute with the specified value.
Example: \`\`\`js var element = document.getElementById(“myDiv”); \`\`\`1. `document.getElementsByClassName(className)`: This method returns a collection of all elements in the document with the specified class name.
Example: \`\`\`js var elements = document.getElementsByClassName(“myClass”); // elements0 will return the first element with the class “myClass“ \`\`\`1. `document.getElementsByTagName(tagName)`: This method returns a collection of all elements in the document with the specified tag name.
Example: \`\`\`js var elements = document.getElementsByTagName(“div”); // elements0 will be the first “div” element in the document \`\`\`1. `document.querySelector(selector)`: This method returns the first element that matches a specified CSS selector(s) in the document.
Example: \`\`\`js var element = document.querySelector(“.myClass”); \`\`\`1. `document.querySelectorAll(selector)`: This method returns all elements in the document that matches a specified CSS selector(s).
Example: \`\`\`js var elements = document.querySelectorAll(“div > .myClass”); // elements0 will return the first element that fulfills the criteria. \`\`\`Remember that `getElementById` returns a single object, while `getElementsByClassName`, `getElementsByTagName`, `querySelectorAll` return a HTMLCollection or NodeList of objects, even if there is only one match.