Change Text into Links
- From: littleredhairedgirl <littleredhairedgirl@xxxxxxxxx>
- Date: Wed, 8 Jul 2009 06:24:10 -0700 (PDT)
I have a page that loads some text into a div
What I'd link to do is (re)create each word into a link.
so loop thru each word in the div with innerHtml and wrapping it with
anchor tag
<script language="javascript" type="text/javascript">
function linkWord(obj){
{
sObj.link="http://groups.google.com/groups/search?q=";
for(i in obj){
var x = document.body.innerHTML;
var linkStart = '<a href="'+ x +'">';
var linkEnd = '&btnG=Search&sitesearch=groups.google.com</a>';
x = linkStart + x + linkEnd);
document.body.innerHTML = x;
}
</script>
.
- Follow-Ups:
- Re: Change Text into Links
- From: Evertjan.
- Re: Change Text into Links
- Prev by Date: Re: JavaScript Eventhandler Functions That Use The "this" Keyword
- Next by Date: Re: Change Text into Links
- Previous by thread: JavaScript Eventhandler Functions That Use The "this" Keyword
- Next by thread: Re: Change Text into Links
- Index(es):
Relevant Pages
|