How to automaticly add a page number to all internal links on the HTML page?

Posted by Tomasz on Stack Overflow See other posts from Stack Overflow or by Tomasz
Published on 2012-08-28T15:18:04Z Indexed on 2012/08/28 15:38 UTC
Read the original article Hit count: 215

Filed under:
|
|

In print mode, I would like to render such a links:

<a href="#targetPage">link</a>

like this:

<a href="#targetPage">link (page 11)</a>

(suppose the target page is on 11. page in print preview).

It is possible to add page number using counters to the page footer with plain CSS, but could I use this in more "the way I want it" way?

The solution doesn't need to be cross-browser (FF/Chrome is enough), any CSS/Javascript tricks are allowed...

© Stack Overflow or respective owner

Related posts about JavaScript

Related posts about html