我可以使用「空白」類來標識dom的公共元素,以便使用jquery執行操作嗎?我所知道的標籤ID和名稱必須是在DOM中唯一的,但是,如果我需要標識相似的元素,但不是必需具有相同的造型...... 例如,在這樣的場景:使用空白類標識元素或其他標記
<section class="custom-section identify1"></section>
<section class="custom-section identify1"></section>
<section class="custom-section identify2"></section>
<section class="custom-section identify1"></section>
<section class="custom-section identify2"></section>
<section class="custom-section identify1"></section>
在這種情況下custom-section
造型的部分和確定X組相似的部分... ¿是正確的? 現在使用jQuery我可以得到identifyX所有部分:
$(".identify1)
我知道在HTML5中存在的自定義數據atributte(數據 - *)custom data HTML5 我可以使用此標記這個functionallity?