Cope the code for the page
function addIdToHeading(){
allHeading.forEach(i => {
const id = i.innerText
.split(" ")
.join("-")
.toLowerCase();
i.setAttribute("id", id);
});
HTML SECTION
Lorem ipsum dolor sit amet consectetur adipisicing elit. Sint maxime quisquam optio voluptatibus fuga eum tenetur fugit aliquid, blanditiis ratione quaerat! Quibusdam ullam provident adipisci dignissimos cupiditate nobis dolorum? Natus.
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>Campping Site Design</title> <link rel="stylesheet" href="style.css"> </head> <body> <section> <div class="container"> <header> <div class="nav"> <div class="logo"> <h6><b>Campp<span>ing</span></b></h6> </div> <div class="nav_menu"> <ul> <li>Home</li> <li>About</li> <li class="active">Contact</li> <li>Blog</li> <li>Event</li> </ul> </div> </div> </header> <div class="main_container"> <div class="heading"> <h2>Nature Calling</h2> </div> <div class="text_containt"> <p>Lorem ipsum dolor sit amet consectetur adipisicing elit. Sint maxime quisquam optio voluptatibus fuga eum tenetur fugit aliquid, blanditiis ratione quaerat! Quibusdam ullam provident adipisci dignissimos cupiditate nobis dolorum? Natus.</p> </div> <button class="btn">Join Us</button> </div> </div> </section> </body> </html>
0 Comments