At a previous job I was trying to help a fellow developer out with what they were trying to accomplish and in doing so, I came up with what you’re going to see below. Just as a note, they never ended up needing this at all ^_^!

So what’s this post about? Well, I’m going to try and show you another option for collecting and saving content. I’ve heard some magazine and newspaper websites are doing things like this, but I haven’t seen it anywhere except for analytics tracking. As a note, this is not at all a polished nor finished demo, but I’d like to see what kind of examples other developers can or maybe have already done with this. I hope you’ll find my code as a good starting place for getting started with your own tests.

So the first thing we need to do is setup the highlighting functionality so we can figure out which piece of content we’re actually on. As a note, I took this from someone else’s post a while back and have just slightly modified.

What this is doing is inserting a span with the class of selectedText around the currently highlighted piece of text. You can then place an event handler on that span tag, such as what I’ve done below.

So there you have it. It’s nothing too advanced, but it’s a fun and powerful option that should give you more ideas for collecting data, allowing users to highlight and store specific pieces of content, or maybe even play around with some easter eggs and try to see who finds them! Again, here is the link to my demo and you can download the code.

Please be sure to let me know of some examples anyone has developed using something like this. I’m definitely interested in seeing what could be done.

Quick Info

Michael Stone is a young and successful web developer living in South Jersey. Originally from the scenic Upstate New York, he has a passion for nature and all things it has to offer.

When he isn't out venturing into new locations, he's usually found inside working on various projects that incorporate ColdFusion, jQuery, CSS and often times PHP.

Another love of his is helping individuals in any way he can. He dreams of becoming a college professor and enlightening young minds. He has an uncanny discipline when it comes to work and it's allowed him to grow exponentially, not only as a developer, but as a hopeful future manager.