tags:

views:

193

answers:

5
$('#div1').children('div:last').css('border-bottom', '');
$('#div2').focus();

I am using above and it works fine with ie but not with chrome & safari. I haven't tried FF.

1st line is to find all child divs and remove underline from last one. 2nd one is to focus on div2 on some action.

What could be wrong in here? Or do i need any special treatment for those browsers?

A: 

Have you tried this instead?

$('#div1').children('div:last').css('border-bottom', 'none');
$('#div2').get(0).focus();
DrJokepu
A: 

If you want to remove the bottom border, try to set the border width to 0:

$('#div1').children('div:last').css('border-bottom-width', '0');
Gumbo
+1  A: 

Focus() is really intended to be used with input elements -- which a DIV is not. Of course, I have no way of knowing whether you've given one of your inputs the name "div2", but I suspect not. I think what you really want to do is scroll to the position of the div, not give it focus (or you could give focus to an input in the div). Thankfully, there's a plugin for that.

As to the border issue, I'd try using 'none' instead of ''.

tvanfosson
A: 

For the first one try this:

$('#div1').children('div:last-child').css('border-bottom', '0');

for the second one, I agree with tvanfosson.

krishna
A: 

i'm having a problem on this site: http://www.thespacecentre.com/rooms-and-pricing.html

any ideas?

Meeting Rooms London