Surah Saba, ayah 14

34:14

فَلَمَّا قَضَيۡنَا عَلَيۡهِ ٱلۡمَوۡتَ مَا دَلَّهُمۡ عَلَىٰ مَوۡتِهِۦٓ إِلَّا دَآبَّةُ ٱلۡأَرۡضِ تَأۡكُلُ مِنسَأَتَهُۥۖ فَلَمَّا خَرَّ تَبَيَّنَتِ ٱلۡجِنُّ أَن لَّوۡ كَانُواْ يَعۡلَمُونَ ٱلۡغَيۡبَ مَا لَبِثُواْ فِي ٱلۡعَذَابِ ٱلۡمُهِينِ ١٤

Falammā qadaynā 'alayhil-mawta mā dallahum 'alā mawtihī illā dābbatul-ardi ta'kulu minsa'atahū falammā kharra tabayyanatil-jinnu al law kānū ya'lamūnal-ghayba mā labithū fil-'adhābil-muhīn

And when We decreed for him [i.e., Solomon] death, nothing indicated to them [i.e., the jinn] his death except a creature of the earth eating his staff.1222 But when he fell, it became clear to the jinn that if they had known the unseen, they would not have remained in humiliating punishment.1223

Footnotes

1222 Upon which he was leaning at the time of his death. A termite continued to gnaw into the stick until it collapsed under his weight.

1223 i.e., hard labor. This verse is evidence that the jinn do not possess knowledge of the unseen, which belongs exclusively to Allāh (subḥānahu wa taʿālā).