クリックすると、テキストを含む非表示の要素を表示する3つの画像があります。ただし、1つを表示するときは、他の2つの非表示要素が非表示になっていることを確認したいと思います。したがって、#img2をクリックすると、#text2は表示されますが、#text1と#text3は非表示になります。また、これは構文エラーである可能性がありますが、すべてのコードをscriptタグの下に配置しようとすると、正しく機能しませんでした。また、HTMLのonclick機能を使用するのではなく、すべてのjqueryをscriptタグに配置したいと思います。私はjqueryに非常に慣れていないので、すべての助けに感謝します。前もって感謝します!
<div id = "img1" onclick = "$('#text1').fadeIn(500)"></div>
<div id = "img2" onclick = "$('#text2').fadeIn(500)"></div>
<div id = "img3" onclick = "$('#text3').fadeIn(500)"></div>
<div id = "text1" hidden></div>
<div id = "text2" hidden></div>
<div id = "text3" hidden></div>
<script>
/* TODO: Put all on-click code here */
</script>