Please find below code
var count = 2
var duration = 500;
jQuery('.owl-slider').trigger('to.owl.carousel', [count, duration, true]);
jQuery
Remove query params from url without reload
<script>
jQuery(document).ready(function(){
window.history.replaceState(null, null, window.location.pathname);
});
</script>
OWL carousel items overlapping
.owl-carousel .animated {
-webkit-animation-duration: 20ms;
animation-duration: 20ms;
-webkit-animation-fill-mode: both;
animation-fill-mode: both;
}
Validate URL using jQuery
var url = "https://avinashkonanki.com/";
var url_validate = /(ftp|http|https):\/\/(\w+:{0,1}\w*@)?(\S+)(:[0-9]+)?(\/|\/([\w#!:.?+=&%@!\-\/]))?/;
if(!url_validate.test(url)){
alert('error');
}
else{
alert('success');
}
Check click target using jQuery
$(document).click(function(event){ $target = $(event.target); if(!$target.closest('.div-content').length){ alert('outside'); }else{ alert('inside'); } });
Get radio button value on change
var radio_data = $('input[name="gender"]').change(function () { var value = radio_data.filter(':checked').val(); alert(value); });
Disable Copy or Paste action for text box
jQuery(document).ready(function(){ jQuery('#input').bind('cut copy paste', function(e) { alert('copy and paste disabled'); e.preventDefault(); }); });
jQuery validation to allow only numbers OR only characters
Allow only numbers
$(‘#zip’).keypress(function(event){
if(event.which != 8 && isNaN(String.fromCharCode(event.which))){
event.preventDefault();
}
});
Allow Characters with dots
$(‘#name’).keypress(function(event){
var inputValue = event.charCode; if(!(inputValue >= 65 && inputValue <= 120) && (inputValue != 32 && inputValue != 0 && inputValue != 46)){
event.preventDefault();
}
});

How to get parameters from current page URL using jQuery
Change paragraph first letter to capital using jQuery
Change paragraph first letter to capital using jQuery
jQuery(document).ready(function(){ jQuery("textarea").keypress(function(){ var txt = jQuery(this).val(); if(txt.length<2){ var res = txt.toUpperCase(); jQuery(this).val(res); } }); });