Find HTML tag elements

Find HTML elements

Typically, with JavaScript, you need to manipulate HTML elements.

In order to do this, you must first find the element. There are three ways to do this:

  • Find HTML element by id
  • Find HTML elements by tag name
  • Find HTML elements by class name

take a chestnut


Through document, you can find child elements by id, className, etc.

But in addition to document, other child elements can only be found through the following three methods

attached picture



Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326005841&siteId=291194637