There is a link and a div. How to implement the replacement of the contents of the div content on the link by clicking on the link using Jquery?
<a class="a">Текст1</a> <div class="b">Текст2</div>
There is a link and a div. How to implement the replacement of the contents of the div content on the link by clicking on the link using Jquery?
<a class="a">Текст1</a> <div class="b">Текст2</div>
$('.a').on('click', (e) => { e.preventDefault(); $('.b').text($('.a').text()); }); on ? and why not use this inside? - teran am$('.a').on('click', (e) => { e.preventDefault(); $('.b').text($(e.target).text()); }); - Lyuba IvanovaSource: https://ru.stackoverflow.com/questions/967743/
All Articles