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

  • SEARCH
  • Home
  • 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 4342576
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T11:38:11+00:00 2026-05-21T11:38:11+00:00

hi i display box with ajax returned results, which has 1 to 4 list

  • 0

hi i display box with ajax returned results, which has 1 to 4 list elements in it

on press of down arrow i am setting a coloured border for the next list item . i tried with ‘.next()’ . what happens is , when i press down arrow the all elements except the first get highlighted
i couldnt do it. help me

$('.input_for_chain_and_target').keyup(function(){data_fr_chain_and_target(this.id);});
$('.input_for_chain_and_target').bind('keydown',controlling_with_nav_keys);



function controlling_with_nav_keys(event){
var keycode = (event.keyCode ? event.keyCode : event.which);
if(keycode==40){//alert('down');
    $('.target_frnd_content').next().css('border','2px dashed #6698FF');
}
else if(keycode==38){
    $('.target_frnd_content').prev().css('border','2px dashed #6698FF');
}

i tried to paste it but it gets distorted due to genration of html by php code

here is the approximate copy

<li style='border:1px solid #F4F3F0;' class='target_frnd_content' id=\"$target_frnd_content_id\">

$usr_img

$usr_namex
(Additional Message)

  • 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-21T11:38:12+00:00Added an answer on May 21, 2026 at 11:38 am

    Okay, I get it. Basically you’re selecting the item through it’s class name which is “target_frnd_content” and I believe you would have given the same class name to rest of the items and that’s why it’s selecting all the next items as every item has the same class name. You must uniquely identify each list item, maybe by adding an id attribute to each one. What else you can do is something like this:

    <ul class="some_list">
      <li class="current">Item one</li>
      <li>Item two</li>
      <li>Item three</li>
    </ul>
    

    then in javascript you’ll say:

    var current = $('li.current');
    current.removeClass('current').next().addClass('current');
    

    Now you can set whatever styling you want to the current class in the css file such as:

    li.current{border: 2px dashed #6698FF;}
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am using fancy box iframe to display my page which has the file
Im using Ajax to get a value from the Drop down box and display
When i add a list (ul) to a div that uses display:box, then it
I need to display an alert box in other than English language for which
I have an @Ajax.ActionLink which for which I would like display a confirmation dialog
I tried every thing which i using but ajax did not display the output
I want to display message box contain label and textbox and ok button and
I've been trying to display the box characters using PDCurses but for some reason
I would like to achieve the following: On homepage load, display modal box Within
I want to display an alert box multiple times with a button click event

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.