jQuery rewrite copied text before pasting
I have a simple jquery script that copies a text from a html element and pastes it into a input fields value.
var txt=$('div').text();
$('#name').val(txt);
The problem I have is that I need to rewrite some of the text that has been copied before adding it to the input field.
When the text is copied and pasted it shows '%40' I need to rewrite '%40' and make it an '@' symbol.
Could somebody please 开发者_StackOverflow社区help?
Try the unescape function: unescape(txt)
For example: unescape("email%40example%2ecom")
returns "email@example.com"
精彩评论