Now that the easy of inserting HTML into the alert has been changed the docs need to provide a simple example for people how simple want to format the content. I propose something like below
```
var content = document.createElement('div');
content.innerHTML = 'Some fields have errors.
Please check and try again.';
swal({
title: 'Error',
content: content,
icon: "error",
})
````
I propose @carloscfcortez's example below
It would be great if this could be incorporated into swal itself
swal({
title: 'Error',
content: {
element: 'div',
innerHTML: 'Some fields have errors.<br/>Please check and try again.'
}
icon: "error",
})
Agreed ! or multiple elements shoud be supported indeed
I agree. Had to find out how to use HTML in swal from this issue...
swal({
title: 'Error',
content: {
element: "div",
attributes: {
innerHTML: "Some fields have <strong>errors.</strong><br/>Please check and try again."
},
},
icon: "error",
})
I was close 馃槤
Please also note in the docs that content and text is not the same thing, by the default the CSS class is different (swal-text vs swal-content) and so content and text differ visually.
Most helpful comment
It would be great if this could be incorporated into swal itself