Why doesn't this work? What would be a plausible solution to get this effect?
$(document).ready(function() {
$('#myLink1').click(
function() {
$('#myLink1').replaceWith('<a id="myLink2" href="#panel2">#panel2</a>');
});
$('#myLink2').click(
function() {
$('#myLink2').replaceWith('<a id="myLink3" href="#pa...
I have this code
$(document).ready(function(){
$('.selector').click(function(){
obj = $(this);
obj.replaceWith('<div class="size">whats up man ??!</div>');
alert(obj.html());
});
});
I want to get the new content of 'obj' that has been 'replaceWith'
but,
I get the old content instead ...
how do I get...
Hello! How can you get:
<a href="page.html" class="class1 class2" id="thisid">Text</a>
changed to
<p href="page.html" class="class1 class2" id="thisid">Text</p>
I'm familiar with jQuery's replaceWith but that doesn't keep attributes/content as far as I know.
Note: Why would p have a href? Cuz I need to change p back to a on a...
Here is the scenario... I have a a checkbox next to each field that I am replacing on page load with jquery with "Delete" text that enables me to delete the field via jquery, which is working fine. Like so...
$(".profile-status-box").each(function(){ $(this).replaceWith('<span class="delete">' + 'Delete' + '</span>') });
The problem...