Hi guys!
I’m trying to do a ‘simple’ replace from one div to another. I’ve searched and found some jquery scripts but can’t seem to get it to work…I probably just have the syntax wrong…could somebody please help?
The code I have is below. I just want to replace the div.address with div.addressEdit when a user clicks the ‘edit’ link.
Thanks so much!
Len
<script>
$(“a.address”).click(function () {
$(“div.address”).replaceWith( $(“.addressEdit”) );
});
</script>
<div class=”address fLeft” style=”margin-right:20px;”>
<p><input type=”radio” value=”” style=”margin-right:10px;” name=”shipto”> Ship to this Address</p>
<blockquote>
<p><strong>Work</strong><br />
UniFirst Corporation<br />
Patrick O’Leary<br />
68 Jonspin Rd.<br />
Wilmington, MA 01887<br />
(978) 658-8888<br />
<a class=”small address” href=””>edit</a> | <a class=”small” href=””>remove</a></p>
</blockquote>
</div>
<div style=”display:none;”>
<div class=”fLeft addressEdit” style=”margin-right:20px;”>
<p><input type=”radio” value=”” style=”margin-right:10px;” name=”shipto”> Ship to this Address</p>
<blockquote>
<input class=”address” value=”Work” /><br />
<input class=”address” value=”UniFirst Corporation” /><br />
<input class=”address” value=”Patrick O’Leary” /><br />
<input class=”address” value=”68 Jonspin Rd.” /><br />
<input class=”address” value=”Wilmington, MA 01887″ /><br />
<input class=”address” value=”(978) 658-8888″ /><br />
<a class=”small” href=”#” onClick=”window.location.reload();return false;”>cancel</a> | <a class=”small” href=””>remove</a></p>
</blockquote>
</div>
</div>