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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T23:07:11+00:00 2026-05-17T23:07:11+00:00

Is there an issue with replacing the contents of a <span in jQuery. I

  • 0

Is there an issue with replacing the contents of a <span in jQuery.

I have this;

<span class='DimensionList'>
  some html
</span>

and

$('.DimensionList').html("<b>This is the new html</b>");

What I’m finding is that in FF the contents of the span are being added to. So the new HTML sits above the old.

In IE6, yes I have to cater for it, it’s doing much the same.

EDIT

I have edited the question to show that there is html in the replacement html

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

    Since there’s no markup in your replacement text, use text() instead of html():

    $('.DimensionList').text("This is the new html");
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

There is an issue that I cannot solve, I've been looking a lot in
i just wondering is there any performance issue or anything thing wrong if that
I have used the cURL solution to solve XSS but there is an issue
There seems to be an issue simulating the backspace key with java.awt.Robot . This
There are nice SO question and answers about this issue, but these options didn't
I have an issue that I have seen come up in a couple different
I have been struggling with this issue for the past couple days: I have
I have a weird issue with a php redirect script that does the following:
So some time ago I was investigating an issue that I knew would be
There is issue, when Uploadify plugin desn't POST more than 1 parameter. Tried 3

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.