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 6881753
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T05:10:08+00:00 2026-05-27T05:10:08+00:00

<div id=button> Click me </div> <div id=item1> //loads with a dashed border </div> <div

  • 0
<div id="button">
Click me
</div>

<div id=item1> //loads with a dashed border
</div>

<div id=item2> //loads with a solid border
</div>

<div id=item3> //loads with a solid border
</div>

Script part:

var eventNext = document.getElementById("button");
eventNext.addEventListener("click", move, false);

function move()
{

}

What would I put in the move function to get the next div item that does not have a dashed border, and make it dashed, and current item’s border to solid? (if there is a next item)?

  • 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-27T05:10:09+00:00Added an answer on May 27, 2026 at 5:10 am

    Here’s one way with jQuery, if using this library happens to be an option for you:

    First, give each div which can become dashed, a “marker class”

    <div id="item1" class="itemWhichCanBeDashed">
        //loads with a dashed border
    </div>
    <div id="item2" class="itemWhichCanBeDashed">
        //loads with a solid border
    </div>
    <div id="item3" class="itemWhichCanBeDashed">
        //loads with a solid border
    </div>
    

    Then create a dashed border style:

    <style type="text/css">
        .dashed { border-style: dashed; }
    </style>
    

    Then, to dash the next div that’s not already dashed:

    $("div.itemWhichCanBeDashed:not(.dashed):first").addClass("dashed");
    

    This selects all divs with the class itemWhichCanBeDashed, but does not have the dashed class attached, then takes the first one, then adds the class dashed

    If you want the first div to already be dashed, then just render it with the dashed class.

    I’m not sure exactly what the requirement of making the current div solid is, but it should be a simple extension of this.

    EDIT

    To host jQuery in your project, you can link to it from Google:

    <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.0/jquery.min.js"></script>

    If your user has recently visited a site that was linking to the same file, it’ll likely be cached. If not, it’s only about a 92K download.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

How to Update a div tag in Master Page using a button click in
I have code to create another row (div with inputs) on a button click.
I have a div which opens when I click a menu button, I am
I have a script, see below: Index page: jQuery script <script type=text/javascript> $(document).ready(function(){ $(#loadmorebutton).click(function
I need to add the following div structure when i click button at every
Consider the following: <form runat=server> <div> <asp:TextBox runat=server ID=tb1 /> <asp:Button runat=server ID=b1 OnClick=b1_Click
I am trying to center a div button and its not working here is
I have a usercontrol that hides a div when a button is clicked. <asp:LinkButton
I have 3 div tags. Each having no. of textboxes and button. Each textbox
I was wondering how to toggle a child div only, clicking in a button

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.