Load links as unselected in jQuery

Posted by shummel7845 on Stack Overflow See other posts from Stack Overflow or by shummel7845
Published on 2010-12-22T23:47:14Z Indexed on 2010/12/22 23:53 UTC
Read the original article Hit count: 103

Filed under:

I have sets of links with id and name attributes, id for individual identifiers and names for groupings. In my jQuery, I have a click function that manipulates the CSS based on what a user clicks on.

But I want to start the freshly loaded page with some of the links disabled (no href attribute) and with a style applied. I tried this, but it didn't work.

$(function() // Alias for $(document).ready()
{ 
var $links = $('li a');   

     $links.(function(){
                $('a[name="beam"]').filter(function() {
                    $(this).addClass('unavailable');
                    $(this).removeAttr('href');
                });

            }); ......

Ideas? (Beam is one of the groupings by name).

© Stack Overflow or respective owner

Related posts about jQuery