What is the simplest way to format 1234213412341
to 1234.2134.1234-1
using JavaScript?
<script>
function formatar_valor(strvalor){
var formatado;
// formata
return formatado
}
alert(formatar_valor('1234213412341'));
</script>