Im making a pagination in react my problem is that when the page loads it should set color to 1st element in array indicating page 1 and also if i click the 1st or last button is should highlight the 1st or last page.Css focus works only if i click the page number.
<button>First Item</button> <div>{pages number}</div> // 1,2,3,4,5,6,7,8,9 <button>Last Item</button> .btnpage{ background-color:green; } .btnpage:focus { background-color: red; color: white; } https://stackoverflow.com/questions/66524156/how-to-access-specific-index-in-array-and-change-its-background March 08, 2021 at 12:04PM
没有评论:
发表评论