Advertisement
bobo_bobkata

Untitled

Oct 10th, 2019
137
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.43 KB | None | 0 0
  1. function toggle() {
  2. let extra = document.getElementById("extra");
  3. let button = document.querySelector("#accordion > div.head > span")
  4. // debugger;
  5. let str = button.textContent;
  6. console.log(button.textContent);
  7. if (str === "More") {
  8. extra.style.display = "block";
  9. button.innerHTML = "Less";
  10. } else {
  11. extra.style.display = "none";
  12. button.innerHTML = "More";
  13. }
  14. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement