Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

How to add css to js .text() ?


Tsimi

Recommended Posts

I can't figure out how to add simple css attibutes to a javascript .text().

 

The stripe payment module has the following 2 codes and I want to change their appearance.

$form.find('.payment-errors').text(response.error.message);


} catch ( error ) {
 \$form.find('.payment-errors').text(error);
}

so how to add styles to

.text(error);

or

.text(response.error.message);

?

Link to comment
Share on other sites

I can't figure out how to add simple css attibutes to a javascript .text().

 

The stripe payment module has the following 2 codes and I want to change their appearance.

$form.find('.payment-errors').text(response.error.message);

 

Looks like that jQuery is writing in the error text 'on the fly' within a feedback loop so if you try adding a line after the above like:

 

$form.find('.payment-errors').css('background-color', 'yellow');

 

or if there's specific classes assigned to the payment-errors then look at https://api.jquery.com/addclass/for swapping in/out classes

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...