fork download
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. </head>
  5. <body>
  6.  
  7. <div class="container2">
  8. <div class="text2">
  9. テキスト2-1
  10. </div>
  11. <div class="text2">
  12. テキスト2-2
  13. </div>
  14.  
  15. </div>
  16. <script>
  17.  
  18. function textCutting(parentSelector){
  19. let nodecollection = document.querySelectorAll(parentSelector);
  20.  
  21.  
  22. nodecollection.forEach(parent_element=>{
  23. let children = parent_element.children;
  24. for(each_element of children){
  25. each_element.textContent=;
  26.  
  27. }
  28.  
  29. });
  30.  
  31. }
  32.  
  33. textCutting(".container2");
  34. </script>
  35. </body>
  36. </html>
Not running #stdin #stdout 0s 0KB
stdin
Standard input is empty
stdout
Standard output is empty