tags:

views:

56

answers:

3

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;
      }

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

here is the html:

<a href="/record/123.wav">play</a>
+1  A: 
$("a").attr("href")
MBO
A: 

You should be able to use the attr method

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