The entire verse is "Now when all the Amorite kings west of the Jordan and all the Canaanite kings along the coast heard how the LORD had dried up the Jordan before the Israelites until we had crossed over, their hearts melted and they no longer had the courage to face the Israelites."
The Hebrew clause וְלֹא־הָיָה בָם עוֹד רוּחַ is translated as "and they no longer had the courage," although it's literally something like "and there was no longer any spirit in them," which is how the ESV translates it. Because the word courage is related to cor, the Latin word for heart, the NIV translation actually exhibits a sort of parallelism between "their hearts melted" and "they no longer had the courage."