Click here to Skip to main content
15,896,481 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Problem : div just appears for a second and then disappears.....?????
JavaScript
$(document).ready(function () {

    $("#done").click(function () {
        $('#txtname').replaceWith(function () {

            return '<div>' + $(this).val() + '</div>';
        });
    });
Posted
v2
Comments
Sandeep Mewara 22-Sep-12 17:40pm    
Give some height/width to div and see.

1 solution

Try this..
$("#done").click(function () {
        $('#txtname').replaceWith("<div>"+$(this).val()+"</div>");
    });
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900