That should work in theory, but your structure is wrong.
If you do something like this:
Will this work?
you will see that it works when you click it.
The javascript: protocol is not necessary, but it won't break anything
if you leave it in.
Hi there,
You say you want to do this by calling a function, not by clicking.
But let me ask you something: How are you going to call the function?
In other words, when do you want this class change to happen? Do you
want it to happen as soon as the page loads? Do you want it to happen
10 second
In that case, you can just remove the href attribute of the link(s):
$("li ul").siblings("a").removeAttr("href");
or, if you want to leave in the href attribute for future use?, you
can do this:
$("li ul").siblings("a").click(function(){
return false;
});
good luck-
First of all, let's clarify the actual HTML. I assume this is what
you have:
Link 1
Link 2
Link 3
Link 3a
Link 3b
Link 3c
Link 4
When you say "remove the link", I assume you want to turn this:
Link 3
into this:
Link 3
I think that $(this) may not work in that context.
See if this works:
$('.panel').each(function(){
$(this).css(/*set CSS here*/);
});
5 matches
Mail list logo