views:

19

answers:

2

i can reference link with specific id with following code

 $(document).ready(function(){
       $("a#example_link_id").click(function(event){
         var url = $(this).attr("href");
          get_uid(url);
         //event.preventDefault();

       });
  });

is it possible to use $("a#example_link_id") this by link name

+5  A: 

Your selector(s) can include specific attributes as well. For example:

$("a[name='foo']");

Which would select

<a href="foo.html" name="foo">Foo</a>

For more information, http://api.jquery.com/category/selectors/

Jonathan Sampson
+2  A: 

you might be looking for this:

var $link = $("a[name=some_name]");

where some_name is the value of the name attribute of the link

mkoryak