Been trying to add a custom error notice with jquery, but so far the div looks funky
jQuery('h1').prepend('<div class=\"error\">Start</div>');
Any tips how to get this to work? As I understand Drupal uses the error div.
Drupal Answers is a question and answer site for Drupal developers and administrators. It only takes a minute to sign up.
Sign up to join this communityBeen trying to add a custom error notice with jquery, but so far the div looks funky
jQuery('h1').prepend('<div class=\"error\">Start</div>');
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('<div class="messages error">Start</div>');
Note that you shouldn't escape double quotes inside a string unless the string is actually wrapped in double quotes.