<!DOCTYPE html> <html lang="ja"> <head> <meta charset="UTF-8"> <title>Document</title> <style> p { transition: font-size 0.3s ease; /* アニメーション効果を付ける場合 */ } </style> </head> <body> <p>これはパラグラフです。</p> <p>ここをクリックしても、フォントサイズは変わります。</p> <script> // bodyタグ全体にクリックイベントリスナーを設定 document.body.addEventListener('click', function() { // すべてのp要素を選択 var paragraphs = document.querySelectorAll('p'); // 各p要素のフォントサイズを200%に設定 paragraphs.forEach(function(paragraph) { paragraph.style.fontSize = '200%'; }); }); </script> </body> </html>