本文介绍了undefined href属性值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
js
js
var hy = $('.Player a.sc-player').attr('href');
console.log(hy);
html
html
<div id="Over_Hidden"></div>
<div id="Wapper">
<div id="Container">
<header>
<div id="Player">
<div class="Player" ><a href="https://soundcloud.com/rapzilla/andy-mineo-stop-the-traffic" class="sc-player"></a>
<p>hellow</p>
<a href="" class="download_song">Download</a></div>
</div>
<!--/Player-->
</header>
<!--/Header-->
{body}
<div class="window_loader"></div>
</div>
<!--/Container-->
</div>
<!--/Wapper-->
控制台给我未定义的原因?
the console give me undefined why ?
推荐答案
html
html
<div id="Over_Hidden"></div>
<div id="Wapper">
<div id="Container">
<header>
<div id="Player">
<div class="Player" ><a href="https://soundcloud.com/rapzilla/andy-mineo-stop-the-traffic" class="sc-player"></a>
<p>hellow</p>
<a href="" class="download_song">Download</a></div>
</div>
<!--/Player-->
</header>
<!--/Header-->
{body}
<div class="window_loader"></div>
</div>
<!--/Container-->
</div>
<!--/Wapper-->
控制台给我一个未定义的原因?
the console give me undefined why ?
href=""
这里需要一个值(链接)。
You need a value (link) here.
var hy =
这篇关于undefined href属性值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!