0

i have a word file with 100 different hyperlinks. Eg: http://word1.com http://word2.com upto http://wordn.com

I have to create a html file with these n links. like word1 which has a hyperlink to word1.com, word2 which has a hyperlink to word2.com etc

Any easy way to do this? rather than copy pasting the link and writing the code?

4

2 回答 2

1

您可以使用 JavaScript 循环来执行此操作。比如for循环:

for (var i=0;i<100;i++)
{ 
    document.write('<a href="http://www.word' + i + '.com">Word' + i + '</a>');
}

像这样...

我不知道这是否是你要找的,但我希望我能帮到你!

于 2012-11-19T04:44:42.780 回答
1

您可以使用一个简单的循环并在每次运行中创建一个锚点。使用Javascript,使用.setAttribute("href", "word"+count+".com")where不断增加。count小提琴

于 2012-11-19T04:49:49.070 回答