I have a function that cleans some attributes out of html tags.
I want to add a textbox to insert the HTML source and get it back all cleaned up but I cant find the way to work with the textbox (simply using .val() or .html() doesn’t help).
An example:
HTML IN – inserted in the textbox
<tr>
<td nowrap="" valign="top" width="47">
<p align="center">Out</p>
</td>
<td nowrap="" valign="top" width="92">
<p align="right">268.292,00</p>
</td>
</tr>
HTML OUT – on a click event ->this code appears in the textbox (or another one) so I can copy/paste it
<tr>
<td>
<p>Out</p>
</td>
<td>
<p>268.292,00</p>
</td>
</tr>
Many questions talk about textboxes but nothing really gave me the way to go…
Thanks a lot for the help
If you are using
input type="text", you can useval(), however, if you are using atextarea, you have to usehtml()as the text inside the box is stored between the opening and closing tags, rather than as a property of the textbox.You can transfer text from one textbox to another like this:
jsFiddle here
Edit: Actually that’s rubbish. You can use
val()