lundi 12 janvier 2015

jquery - Ignoring '\n' string when pasting an Input type="hidden" value


I'm doing a "copy to clipboard" using Zclip (http://ift.tt/14uAeT2). It's copying correctly, but I'm trying to improve it. this is my html code:



<input type="hidden" value="value 01: 789456123 \n value 02: 547812321 \n value 03: 789456423 \n ">
<button id="copy-button">copy</button>


and the js:



$("#copy-button").zclip({
path: "ZeroClipboard.swf",
copy: function(){
return $(this).prev().val();
}
});


I wish to replace "\n" to break lines when I paste it. Here some pics.


alert


enter image description here





Aucun commentaire:

Enregistrer un commentaire