You can modify the querySelectorAll method within the script to target different elements. For example, change 'h2, h3, h4' to 'h1, h2, h3' and target <h1>, <h2>, and <h3> elements instead.