さて、ここではワンクリックで複数のことが起こっていますが、フォーマットする、またはそれを行うためのより良い方法があるかどうか疑問に思っていますか?
<ul><li>Hello</li><li>Welcome</li><li>Howdy</li></ul>
<div class="first">Goodbye</div><div class="second">See ya</div><div class="third">Later Gator</div>
$('li:first-child').click(function(){
$('li:nth-child(2)').removeClass('this');
$('li:nth-child(3)').removeClass('this');
$('.second').hide();
$('.third').hide();
$('li:first-child').addClass('this');
$('.first').show(); });
それぞれ、このようにすると、他の人がクリックされたときに同じプロセスが必要になります。