Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var course = document.querySelector(".course");
- var courseClass = course.className;
- var locations = [
- "Berlin", "Munich", "London"
- ];
- function addLocations () {
- for(var i = 0; i < locations.length; i++) {
- if (courseClass.includes(locations[i])) {
- course.innerHTML = `<h1>${locations[i]}</h1>`
- }
- }
- }
- addLocations();
Add Comment
Please, Sign In to add comment