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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T18:41:55+00:00 2026-05-25T18:41:55+00:00

In this loop, I’m trying to add an event handler to each count. The

  • 0

In this loop, I’m trying to add an event handler to each “count”. The event handler calls a function “hideAll()”, whose input value is “count”.

I am doing so by adding HTML code under the ID “next”, using JQuery’s insertBefore() method.

for (count=1; count<=3; count++)
{    

$('<a href="#" onclick="hideAll(' + count + ');return false;">' + count + '</a>').insertBefore("#next");

}

So when I run it, it gets added, but for some weird reason, it get’s added like this:

<a onclick="hideAll(1);return false;" href="#">1</a>

The string href=”#” is getting moved over to the end. I can’t figure out why.

I tried checking the quotation marks and everything. Everything seems perfect, no idea why it’s doing that.

  • 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-25T18:41:55+00:00Added an answer on May 25, 2026 at 6:41 pm

    What browser are you viewing it in?

    Some browsers, when viewing the dom, shows you its “final” source after it has interpreted the markup.

    Make sure you “View Page Source”, and not “Inspect Elements” to get the pure pre-interpreted markup.

    Ultimately, though, the order of attributes are irrelevant, so it should be fine for your purposes?

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

Sidebar

Related Questions

In this loop, I'm trying to take user input and continually put it in
I'm trying to run this for loop; for (int col= 0; grid[0].length; col++) However
I am trying to do is to loop this HTML and get a nested
I have this simple loop: for($i=$_POST['position'];$i<count($myFiles);$i++) { $withoutNumber = explode(_,$myFiles[$i]); $noNr = unset($withoutNumber[0]); }
What is the pythonic way to perform this loop. I'm trying to pick a
I am trying to make a stop button for this loop but it runs
So I have this loop: <% @images.each do |page| %> <% end %> How
I have this loop // go through each alumni foreach (esDL.Alumni currAlumni in allAlumnis)
In this example I want to add a .loop({quantity},{sleepvalue}) to a method I got
I want this loop to decrement from the value I set it to from

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.