For example, i have a code like this:
<div id='variant'>
<div class='color' value='Red'></div>
<div class='type' value='Normal'></div>
<div class='version' value='1.0'></div>
</div>
<div id='accept'></div>
<a id='sure'></a>
I want to get all of the class and value from the child, and change it to HTML DOM and custom text to #accept
and #sure
like this:
<div id='variant'>
<div class='color' value='Red'></div>
<div class='type' value='Normal'></div>
<div class='version' value='1.0'></div>
</div>
<div id='accept'>
<div class='child'>
<p>Color</p>
<span>Red</span>
</div>
<div class='child'>
<p>Type</p>
<span>Normal</span>
</div>
<div class='child'>
<p>Version</p>
<span>1.0</span>
</div>
</div>
<a id='sure'>Color: Red, Type: Normal, Version: 1.0</a>
Can I do that using jQuery?