div の id を取得し、それを使用してファイル名を呼び出したいのですが、その方法がわかりません。
たとえば、要素は
<p id="smith_janis" class="name">Janis Smith</p>
などのようなもの
$(".name").click(function() {
$(this).get the element's id and turn it into variale maybe?
$("#text").load(the name of the element +".txt"); or $("#text").load("smith_janis.txt");
});
これを行う方法が正確にはわかりません。誰かが私を助けてくれますか? 前もって感謝します。