I have JSFIddle https://jsfiddle.net/rinku16/tfsrnj8y/21/, i done all thing correctly but don't know where is error. Please correct me. You can get all my code at JSFiddle.
I want to move the focus button to next and previous button (only 1,2,3.... NOT on Previous and Next Button) based on button click next/previous. Initialy it will be on 0 orange colored button when i click next it move to 1 colored button and same case for previous button.
JS Code.
$(document).ready(function() {
$('#nextValue').click(function() {
var x = $('.nav-numbers .btn :focus').filter(function () {
return this
});
$('#'+x).css({"background-color": ""});
$('#'+x).next().css({"background-color": "#e67e22", "color": "#ffffff"});
});
$('#PreValue').click(function() {
var x = $('.nav-numbers .btn :focus').filter(function () {
return this
});
$('#'+x).css({"background-color": ""});
$('#'+x).prev().css({"background-color": "#e67e22", "color": "#ffffff"});
});
$('.nav button').click(function() {
/* var start = $(this).text() */;
$(this).css({"background-color": "#e67e22", "color": "#ffffff"});
});
$('.nav button')[0].click()
});
Thanks