开发者

How to get value of href in Jquery

开发者 https://www.devze.com 2023-01-02 07:52 出处:网络
I am trying to grab the value of my href in jquery how is it done\'? This is what I have done: $(\'#playbackbutton\').click(

I am trying to grab the value of my href in jquery how is it done'?

This is what I have done:

$('#playbackbutton').click(
      function() {
         $("#playbackdiv").load("$('a:href').val();", [], function(){
               $("#playbackdiv").dialog("open");
            }
         );
         return false;
      }
开发者_Python百科

I need to get the value of the href in my a tag.

here is the html:

<a href="/record/123.wav">play</a>


<a id="link" href="here.html">here</a>
<script type="text/javascript">
$(function() {
    alert($('#link').attr('href'));
});
</script>


$("a").attr("href")


You should be able to use the attr method

0

精彩评论

暂无评论...
验证码 换一张
取 消