It's unclear if the question accurately reflects what I want to achieve. If I have a form that fades out and is then determined whether to display again through a cookie, can the confirmation message be styled using CSS?
For example, I would like to make the heading <h2>Success</h2>
green. Is it possible to achieve this in my CSS file? Or is there another way?
$(function() {
var completed = $.cookie( 'completed' ),
form = $('#contactform'),
msg = $('#contactf');
if( ( completed != undefined ) && ( completed == 'done' ) ) {
form.hide();
msg.html( '<h2>Success</h2>Thankyou for submitting <b>the form.</b> We will get back to you as soon as possible.' );
}
Edit: Specifically, give this a class name so I can style it in my CSS without affecting all h2 headings on my page.