jQuery addClass example

Change class name on click in jQuery

by Phil Brown

JavaScript

$.getJSON('/echo/jsonp?callback=?', {
	index: 0
}).done(res => {
	console.info(res)
  alert(`Got index ${res.index}`)
}).fail((jqXhr, status, error) => {
	console.error(status, error)
})