There is a code for scrolling through slides with arrows on the keyboard:
$(document).keydown(function(e) { if (e.keyCode === 37) { // Previous $(".carousel-control-prev").click(); return false; } if (e.keyCode === 39) { // Next $(".carousel-control-next").click(); return false; } }); How can you modify this script so that it works only on the current carousel, and not on all the carousels on the page?