range slider inside panel doesn't work

range slider inside panel doesn't work

I have some sort of canvas paint apss on mobile. I would like to increase the paint brush size simply with a range slider but as soon as I increase the value in the slider, the paint brush size does'nt seem to increase at all. Here's the code. I put the range slider inside a panel

  1. <div data-role="panel" data-position="bottom" data-display="overlay" id="bottompaneloverlay2" data-theme="a">
  2.    <div class="ui-bar ui-bar-c">
  3.    <form id="largeurs_pinceau">
  4.  <label for="largeurs_pinceau">Brush Size:</label>
  5.  <input id="largeurs_pinceau" name="largeurs_pinceau" data-mini="true" type="range" data-highlight="true" min="2" max="50" value="5" />
  6.   <output id="output">5 pixels</output>
  7.          
  8.         </form>

  9. </div>
and the javascript of the following is as follows

  1. $("#largeurs_pinceau input[type=range]").change(function() {
  2. if (!isNaN($(this).val())) {
  3. width_brush = $(this).val();
  4. $("#output").html($(this).val() + " pixels");
  5. }
  6. });
could anyone tell me what seems to be the problem here? Thanks in advance