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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T23:04:02+00:00 2026-05-24T23:04:02+00:00

I am creating a LI and appending it to the UL using JQUERY code.

  • 0

I am creating a LI and appending it to the UL using JQUERY code.

     listHtml = "<li id='ordli' whereaboutid='' action='Insert' onthefly='True' class='myDragClass'>" +
    "<div class='orderBox'>" +
    "<span><a href='#' id='114' title='delete' class='itemOrderDelete'>X</a></span></div>" +
    "</li>";

$(this).append(listHtml);

The issue is, IE renders the href with the page url instead of #.

In Firefox 

<a href='#' id='114' title='delete' class='itemOrderDelete'>X</a>

This is correct

But in IE (Compatibility mode)

<a href='http://localhost:1224/pages/index.aspx#' id='114' title='delete' class='itemOrderDelete'>X</a>

This is incorrect

Any idea why the URL is appended in HREF. How to eliminate it? Thanks in advance.

  • 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-24T23:04:04+00:00Added an answer on May 24, 2026 at 11:04 pm

    yes, that happens to IE9 in IE7 compatibility, you can try this fix:

    FOR TEST

    HTML:

      JS

      var listHtml = $('<li id="ordli" whereaboutid="" action="Insert" onthefly="True" class="myDragClass"> \
          <div class="orderBox"> \
          <span><a href="" id="114" title="delete" class="itemOrderDelete">X</a></span></div> \
          </li>');
      
      $(listHtml).find('a').attr('href', '#');
      
      $('ul').append(listHtml);
      
      alert($('ul').html());
      

      test

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

    Sidebar

    Related Questions

    I am creating code to upload images in a folder using PHP, & before
    I'm creating a dropdown box dynamically in jQuery by appending html as follows: .append(<br><SELECT
    I am using jQuery and jQuery UI. Using the getJSON function, we are creating
    I created a report using wizard and while creating I selected 4 columns for
    I am trying to performance test some code. I am using a stopwatch. When
    I am creating list of <span class=infa9span><img src=/csm/view/include/images/foldericon.png/><a id=infa9Service>'+servicename+'</a><br/></span> tags dynamically and appending it
    I'm creating a PostScript file from XML input using xsl-fo (Apache-FOP). I need also
    I am creating an application using TabLayout and am having problems with the display
    I am creating a windows application in C++. I am using SDL ( http://www.libsdl.org/
    I have an xml document that I am creating using the loop below and

    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.