Menu

If a selected element’s location changes on page load (ex: more divs are dynamically added above it), what is a best practice to ensure the selected element is in the right location in the DOM selector on DOM ready?

We help you to get prepared and pass your Marketing online Certification exams. It’s a better way to learn what you need using our Top Quality Time-Saving Guides and practical tips and tricks. More info: https://www.certificationanswers.com/en/

If a selected element’s location changes on page load (ex: more divs are dynamically added above it), what is a best practice to ensure the selected element is in the right location in the DOM selector on DOM ready?

  1.  A)  Manually enter the pre-modified element through the Element Selector.
  2.  B)  Use a less fragile selector e.g. Fragile selector: #container>div:nth-of-type(2)>div:nth-of-type(2)>a>img Less fragile selector: a>img[src=”imageURL.jpg”]
  3.  C)  Use the keyboard shortcut “Shift” to select both the premodified element and the modified element
  4.  D)  Select the modified element.