Hi,
I understand the fundamental of replacing from a <div> to a <button>.
i am having trouble though adding an id to the replacement.
example>
say i have the following code:
<div class="container">
<div class="inner first">Hello</div>
<div class="inner second">And</div>
<div class="inner third">Goodbye</div>
</div>
I am applying this jquery to replace
<div class="inner first">Hello</div>
with <button id="myBtn" class="btn">Hello</button>
<script>
$( "div.first" ).replaceWith( "<button id="myBtn" class="btn">Hello</button>" );
</script>
but it doesn't seem to work right. any help?