If this is your exact markup, you can do this. Also note this is updated to actually work across different browsers. Since your checkbox does not currently have an id, I am using a sibling selector to access it through its parent p tag:
jQuery(function($){ // DOM Ready
$("#passwordID + p input").click(function(){
var new_type = $(this).is(':checked') ? "text" : "password",
pwd = $("#passwordID"); // We keep replacing it, so find it again
if(pwd.attr('type') !== new_type){
pwd.replaceWith(
$("<input />", {type: new_type, value: pwd.val(), id: "passwordID", name: "PasswordName"})
);
}
}).click(); // Trigger it once on load in case browser has remembered the setting
});
Demo on JSBin