How to dynamically change the value of a slider?

How to dynamically change the value of a slider?

I have a page that has been dynamically created that contains a mobile slider.  After this page has been dynamically created, I am loading Ajax data and wish to update the slider position before the page is displayed.  How can this be done?  The slider was created as follows:

<input type="range" name="cvote" id="cvote" value="0" min="0" max="10"  />

I've tried:

$(#cvote).val("3");
$(cvote).slider('refresh');

Above does not work.  Suggestions?