data-name
当我将鼠标悬停在<div class="hover_over">
<div class="hover_over">
<a href="somelink">some value</a>
<div class="menu_info1">
<div class="menu_info2"></div>
<div class="user_menu popover">
<div class="user_menu_nipple"></div>
<div class="user_menu_list"></div>
<a href="someotherlink" class="targetclass" data-name = "What_I_Need" >
</a>
</div> ...
</div>
用于获取“ somelink this.href
”,但一直试图向下寻找。
这是我得到“somelink”的方式:
$(".hover_over").mouseenter(
function () {
localStorage['ls1'] = this.href;
localStorage['ls2'] = this.href.slice(7).split(".")[0];
... some other stuff
}