Frage

I'm new in using modals. I just wanted to ask how can I get a value of a span in a modal window with an id of "span1" and put its value to another modal window that has also a span with an id of "span2"? thanks.

War es hilfreich?

Lösung 2

Something like this:

$('#span2').text($('#span1').text());

Although you'll obviously need to do this under some event, such as the click of a button.

Andere Tipps

You can do something like:

var span1val = $('#span1').html();
$('#span2').html(span1val);

Use JQuery's .html()

 $('#span2').html($('#span1').html());
Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top