<html>
<body>
digite seu texto abaixo em html e ao apertar o botão ele torna-se um texto em javascript.<br>
<script>
function scriptIt(val){
val.value=val.value.replace(/"/gi,""")
val.value=val.value.replace(/'/gi,"'")
valArr=escape(val.value).split("%0D%0A")
val.value=""
for (i=0; i<valArr.length; i++){
val.value+= (i==0) ? "<script>ninfo=" : ""
val.value+= """ + unescape(valArr[i])
val.value+= (i!=valArr.length-1) ? "" + n" : ""n"
}
val.value+="ndocument.write(info)n</script>"
}
function ctrlA(el) {
with(el){
focus(); select()
}
if(document.all){
txt=el.createTextRange()
txt.execCommand("Copy")
window.status='Selecione e copie!'
}
else window.status='pressione Ctrl+c para copiar'
setTimeout("window.status=''",3000)
}
</script>
<center>
<form name="f">
<input type="button" value="HTML -> JavaScript" onclick="scriptIt(document.f.t)" />
<input type="reset" value="apagar">
<input type="button" value="selecionar" onclick="ctrlA(document.f.t)" />
<br />
<textarea name="t" cols="75"
rows="20"></textarea>
<br />
</form>
</center>
</body>
</html>