Choosing page elements by tag name

Objective

  • Select and modify page elements with a specific tag name

document.getElementsByTagName

  • you can use a loop to access all of the elements selected using getElementsByTagName
  • see onclick3.html for an example of using document.getElementsByTagName
  • libraries such as jQuery greatly expand the ability to specify sets of elements
  • libraries such as jQuery greatly expand the ability to work with sets of elements
  • but... recent updates to ECMAScript/JavaScript give us easier native access to some of the capabilities that libraries such as jQuery provide