<!DOCTYPE html><htmllang="ja"><head><metacharset="UTF-8"name="Content-Style-Type"content="text/css"><title>Document</title></head><body><h1style="display: none;">サンプルタイトル</h1><h2style="display: none;">サンプルタイトル</h2><button>ボタン</button><script src="https://code.jquery.com/jquery-3.5.1.min.js"></script><script>$('button').click(function(){$('h1').toggle();$('h2').toggle();})</script></body></html>↧
ボタンをクリックして要素を非表示から表示に切り替える
↧