I am interested in using a jQuery slider for an input on my HTML form.
In certain examples, I see it invoked as an input like so:
<input type="range" name="slider" id="slider-0" value="25" min="0" max="100" />
However in other examples, I see it invoked like this:
<head>
<script>
$(function() {
$( "#slider" ).slider();
});
</script>
</head>
<body>
<div id="slider"></div>
</body>
- What is the functional difference between these two snippets? Does one grant greater customization than the other (e.g. can I customize the background of the slider using the first code)?
- If I want to use the second one in a form, do I need a ``hidden field"?