How can we achieve input type number on tap hold increase value by 1 in mobile,
<input type="text" id="number" value="1">
<span id="upSpan"> Up </span>
$('#upSpan').on('touchstart', function(){ var value = $('#number').val(); $('number').val(value + 1);})
This need to be worked as input type number.
Working example: http://jsfiddle.net/Gajotres/4fewN/
<input type="text" id="number" value="1"/>
<span id="upSpan"> Up </span>
$('#upSpan').on('vclick', function(){
var value = parseInt($('#number').val());
$('#number').val(value + 1);
});
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.