I would like to modify (or to format) the display of numbers with jQuery: each group of three digits separated by a space.
Now when I send data with Php, the formatting is retained. It's boring to end up with an IP address formatted, for instance!
How to fix it?
$(document).ready(function()
//$(function()
{
$('h1, h2, h3, h4, h5, h6, p, li, dt, dd, caption, tr').each(function()
{
var $h = $(this);
var html = $h.html();
html = html.replace(/(\d{3-2})[\s\.]{0,1}(\d{3})/g, "$1 $2");
html = html.replace(/(\d{1})[\s\.]{0,1}(\d{3})/g, "$1$2");
// html
$h.html(html);
})
; });
Thanks for your help.
Regards,
Vincent