大家好我有以下代码,
<ul class="post-buttons">
<li>
<a class="button icon-button thank-icon" title="Thank this post" href="./thank.php?f=12&p=249224"></a>
</li>
</ul>
Run Code Online (Sandbox Code Playgroud)
并在我的JavaScript上我有以下,
var ThankButton = $('div.thank-icon > a').attr('href');
console.log(ThankButton);
Run Code Online (Sandbox Code Playgroud)
但是在控制台日志中我得到的ThankButton没有定义,我在这里做错了什么?