まずは「replace」メソッドを使って縦線「|」を一括削除します。
$(function(){ $('.pageswitch').each(function(){ var txt = $(this).html(); $(this).html( txt.replace(/\|/g,"") ); }); });
.pageswitch{text-align:center;} .pageswitch a{background:#09f;color:#fff;padding:5px;border-radius:3px;} .pageswitch a:hover{background:#f60} .pageswitch strong{background:#f30;color:#fff;font-weight:normal;padding:5px;border-radius:3px;}