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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T04:53:06+00:00 2026-06-16T04:53:06+00:00

This is my code: newS = #newS_+g; //g is a unique number from an

  • 0

This is my code:

    newS = "#newS_"+g; //g is a unique number from an id
    document.getElementById('finderScroll').innerHTML +='<div id="newS_'+g+'"></div>'
       $(newS).slider({
              range: true,
              min: 0,
              max: 500,
              values: [ 75, 300 ],
              slide: function( event, ui ) {
              console.log( ui.values[ 0 ] + ui.values[ 1 ] );
                 }
              });

Each new slider works, but when I add another, the previous slider no longer functions. It causes it to no longer be draggable even though everything about each slider is unique. Does anyone know the solution to this?

  • 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-06-16T04:53:08+00:00Added an answer on June 16, 2026 at 4:53 am

    By updating innerHTML you essentially make the browser to rebuild your DOM from the scratch. Use appendChild instead, that will preserve the event handlers AND data attached to the existing elements.

    In fact, I don’t see why you cannot write like this:

    $('#finderScroll').append($('<div>').attr('id', 'newS_' + g));
    

    … as you already use jQuery. Also, I’d suggest rewriting the assigner block too: you don’t need to traverse the DOM looking for that created element (with $(newsG)), as you can write this:

    $('<div>').attr('id', 'news_' + g).slider({ ... })
        .appendTo($('#finderScroll'));
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I call function from this code : <div id=header-button-news class=header-button-info> <a href=javascript:; title=Новости onclick=showNews()></a>
I have this PHP code : $query = SELECT * FROM news WHERE news_active
Code : news = (from New myNew in new News() select myNew).Distinct().ToList(); but this
I am using this code structure below from here http://www.koonsolo.com/news/dewitters-gameloop/ to set a game
I'm using this code to import images from a rss news feed. $source_xml =
Im using this code for my inputs: $(document).ready(function(){ $('.add-news').each( function () { $(this).val($(this).attr('defaultValue')); $(this).css({'color':'#686868'
In this code : $path = C:\NucServ\www\vv\static\arrays\news.php; $fp = fopen($path, w); if(fwrite($fp=fopen($path,w),$text)) { echo
I'm using this code for get all news: List<aspnet_News> allNews = context.aspnet_News.OrderByDescending(i => i.NewsId).ToList();
Ok, I've got this code that I've been using to spit out news to
This code disabled mouse scroll functionality, when i click on the document. $(document).on(click, function

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.