DEV Community

Muhammad Zubair
Muhammad Zubair

Posted on

How to Load json form in html page and after user submission data display in json raw form?

I hv this code link below:

https://github.com/iamevenstronger/quiz

In this case after user submission the count all user answer and display correct answer, i want to display data like this in end:

{"name":"test name","check":"yes","select":"angularjs","message":"Message text","email":"abc@gmail.com","password":"ABC"}

What changes i should made in index.js to display the required result?

Top comments (1)

Collapse
 
pavelloz profile image
Paweł Kowalski

I would do something like this:

const data = JSON.stringify(object, null, 2);

And slap it into <pre> element to show it formatted.