How to replace input tag with <p> tag
Hallo all.
I need to replace all the input tag of a page with a <p> tag with inside the input value.
I tried in this way
- var inputs = jQuery('input');
jQuery(inputs).each(function() {
var val = jQuery(this).val();
console.debug(val);
jQuery(this).append("<p>"+val+"</p>");
jQuery(this).remove();
});
The problem is that the <p> tag is appended inside the <input> and when i remove it i remove also the <p> just added.
Any idea how to solve the problem?
Kind regards
Massimo