How to add an error notice with jquery? Been trying to add a custom error notice with jquery, but so far the div looks funky

jQuery('h1').prepend('&lt;div class=\"error\"&gt;Start&lt;/div&gt;');


Any tips how to get this to work? As I understand Drupal uses the error div.
Drupal uses messages as the 'base' class for messages so this should work:

jQuery('h1').prepend('&lt;div class="messages error"&gt;Start&lt;/div&gt;');


Note that you shouldn't escape double quotes inside a string unless the string is actually wrapped in double quotes.