The pre tag combined with the code tag

let data = JSON.stringify({ name: 'tim', age: 23, grade: 3 }, null, 2); < pre > < code id = "json" > {data} < / code > < / pre > / / results show that, for such a {" name ":" Tim ", "age" : 23, "grade" : 3}