jQueryで特定のクラスを持つすべてのタグのname
属性を取得したい。<a>
どうすればできますか。
これが私のHTMLだとしましょう:
<div>
<a href="#" name="first" class="myClass">Something</a>
</div>
<a href="#" name="second">Something else</a>
<a href="#" name="third" class="myClass">Something else again</a>
クラスがあるので、「first」と「third」を取得する必要がありmyClass
ます。アンカー「サード」にはこのクラスがないため、必要ありません。