0

I am currently trying to get a value of another area via id to append in the #delivery_prices section. What is the correct way to do this?

#shipping_methods is a dropdown #delivery_price is a div

$('#delivery_price').html($('#shipping_methods').val());
Jess McKenzie
  • 8,345
  • 27
  • 100
  • 170

1 Answers1

0

Don't use val() method for containers like span, div, td ... Use html() or text() methods

$('#delivery_price').html($('#shipping_methods').html());

Read this to have a better explanation about difference between val and text.

Community
  • 1
  • 1
OlivierH
  • 3,875
  • 1
  • 19
  • 32