Ready to watch this entire course?
Become a member and get unlimited access to the entire skills library of over 4,900 courses, including more Web and personalized recommendations.Start Your Free Trial Now
- View Offline
- Including range form elements
- Modifying the display interactively
- Dragging items to wish lists
- Storing wish list items locally
- Saving and retrieving list items
Skill Level Intermediate
Let me just open that up a little bit and scroll down so you can see what's going on. Now we're going to define the function that I've called Print Value, that will set up a couple of variables to get the ID of the slider, as well as the one from the text field. And once we have that, we'll be able to set one value to the other. So we start with a function and as I said, I'm going to call this printValue.
The first is slider and then the second is range value. Finally, let's insert an onchange event to the range control itself. So let's go back up to line 67 and I'm going to add an attribute right towards the end here, of onchange = and then we'll put in our function name which is printValue, and pass it in the two arguments. The first argument is the ID slider and the second argument is the ID for the textbox, which is range value.