Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7687341
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T19:40:56+00:00 2026-05-31T19:40:56+00:00

In here, http://jsfiddle.net/sjKgF/78/ JS CODE $(‘.display_box’).hover(function (){ $(this).attr(‘class’, ‘display_box current’) }, function (){ $(this).attr(‘class’,

  • 0

In here,

http://jsfiddle.net/sjKgF/78/

JS CODE

$('.display_box').hover(function (){            
    $(this).attr('class', 'display_box current')
}, function (){
    $(this).attr('class', 'display_box');
});


$('#search').keyup(
function (e){
    var curr = $('#display').find('.current');
    if (e.keyCode == 40) 
    {                                      
        if(curr.length)
        {
                $(curr).attr('class', 'display_box');
                $(curr).next().attr('class', 'display_box current');
        }
        else{
            $('#display div:first-child').attr('class', 'display_box current');
        }                    
    }
    if(e.keyCode==38)
    {                                        
        if(curr.length)
        {                            
                $(curr).attr('class', 'display_box');
                $(curr).prev().attr('class', 'display_box current');
        }
        else{
            $('#display div:last-child').attr('class', 'display_box current');
        }            
    }
}        
)​

ELEMTS

<input type="text" id="search" name="search_fld"/>
<div id="display">
<div class="display_box current">Luca</div>
<div class="display_box">David</div>
<p class="other">Mark</p>
<div class="display_box">...</div>
</div>

​
How can i skip the <p> element and continue with only <div> ?

Thanks

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-31T19:40:57+00:00Added an answer on May 31, 2026 at 7:40 pm

    Pass a selector to .next():

    $(curr).next('div').attr('class', 'display_box current');
    

    it doesnt work like that, i tried this. it doesnt continue to next DIV with text “…” if i do that

    Okay, let my try my crystal ball again:

    $(curr).nextAll('div').first().attr('class', 'display_box current');
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

All of this is code is here: http://jsfiddle.net/yrgK8/ I have a news section which
I have this code here http://jsfiddle.net/RzBeM/65/ you will see two input fields called quantity.
I found this count down timer code here http://jsfiddle.net/QH6X8/ I would like to make
my code here http://jsfiddle.net/GKZRU/14/ all js working properly, and add/remove css classes(checking this in
I have code located here http://jsfiddle.net/jostster/5XAUb/ This works in Safari / FF (for the
This code works fine here http://jsfiddle.net/LH7sy/11/ It tries to find sml( and )sml in
Hi iam using this code here http://jsfiddle.net/bryanjamesross/pyNJ9/ I segregated the whole code in one
I have a fiddle here http://jsfiddle.net/WULsZ/1/ I load jQuery first and the code is
Please see the demo here: http://jsfiddle.net/Freewind/Vkp4U/ The html: <div class=outer> <div class=x>x</div> <div class=y>y</div>
You can see the example here: http://jsfiddle.net/8EHED/8/ This is a tricky problem because I

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.