Simple code from dom to jquery

I need change this code (In example http://fiddle.jshell.net/4dydsxcf/ )

<form>
    <input type="number" name="counttickets" id="counttickets" min="1" max="1000" value="1" oninput="this.form.countticketsRange.value=this.value" />
    <br />
    <input type="range" class="inrange" name="countticketsRange" min="1" max="1000" value="1" oninput="this.form.counttickets.value=this.value" />
</form>

To jquery, without oninput , thanks for help

No need more help, found way

<input type="number" name="counttickets" id="counttickets" min="1" max="1000" value="1" />
<br />
<input type="range" class="inrange" id="countrange" name="countticketsRange" min="1" max="1000" value="1" />

$('#countrange').on('change', function () {
    $('#counttickets').val($('#countrange').val());
});
$('#counttickets').on('change', function () {
    $('#countrange').val($('#counttickets').val());
});
$('#counttickets').on('keyup', function () {
    $('#countrange').val($('#counttickets').val());
});

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.