Why this code doesnot work, need debug

See the Pen Random Quote by Eldar (@eldarm) on CodePen.

When you submit a form, the default action is to reload the page. To prevent it you should use preventDefault():

function loadData(e) {  // <-- e is event (in this case submit)
  e.preventDefault()  // <-- prevent default event action (don't reload)
  ...