className is not a function

Viewed 5497

When I run the following code:

theAlert = document.createElement("div");
theAlert.className('alert alert-danger');

I get this error:

theAlert.className is not a function

What is wrong how come this doesn't work?

2 Answers
Related