This is a common issue with the 98 TJ's, I have two if them , and both have had this issue. IOM hit it on the head with the dash connectors.
On my first Jeep, I had it in the the shop for evaluation twice, before I found a tech service bulletin from Jeep, and took that info to the stealership. New connector wired in at a cost of 350 bucks. (it works out at about 467 bucks an hour )
On the other Jeep, I removed the dash console, far enough to get to the connector, ( with battery totally un hooked) and scraped the terminals of the connector, applied dielectric grease, and slapped it back together. AND it actually worked. I figure it took 45 minutes start to finish. ( including reading the Haynes book)
It will only get worse, and will go out while there are 4 coppers following you through a school zone, and you'll have no speedo. Dont ask how I know this ................