I have a site with thousands of htm documents on them. Sometimes I need to send someone to a specific paragraph to read. What I am looking for is a jquery plugin which simply adds ids to all the paragraphs, making them linkable, so we could send them to: http://www.demo.com/index.html#p_10 for instance.
相关问题
- Views base64 encoded blob in HTML with PHP
- How to fix IE ClearType + jQuery opacity problem i
- jQuery add and remove delay
- Is there a way to play audio on a mobile browser w
- HTML form is not sending $_POST values
Why a plugin? And no need for an ID
This should work if you insert a script into the page or into an existing external script
NOTE: This does NOT modify the DOM in any way and is WAY faster than an .each
I think what you want is just a simple code like this
Here is an example that also displays the id set.
http://jsfiddle.net/ekftprLt/2/