Marshmallows 0 Newbie Poster

I am very new to JavaScript/JQuery and would really appreciate some help.
I have javascript code for a ui slider in a base template, I then have a separate template that extends the base for my web page. I am having a problem getting the slider value variable displayed to the screen in an HTML string, so currently the user does not know what value they are selecting. I have tried document.write with no luck. Would anyone have any suggestions?

My UI Slider JavaScript is:

$(function() {
           var select = $( "#logs");
           $("#slider").slider({
                min: 1,
                max: 6,
                step: 1,
                value: select[0].selectedIndex + 1, 
                slide: function(event, ui) {
                     select[0].selectedIndex = ui.value - 1;
                    }
            });

            $('#logs').after(slider).hide();
            
      });

The ui slider controls a hidden select option box, so it is the value that i would like displayed to the user as they scroll along the bar.

Many thanks in advance for my tips given!!

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.