请帮助我如何将JQuery脚本转换为纯Javascript?我是PL的初学者。 谢谢如何将JQuery转换为纯Javascript?
这里的jQuery脚本:
$(document).ready(function() {
$('address').each(function() {
var link = "<a href='http://maps.google.com/maps?q=" + encodeURIComponent($(this).text()) + "' target='_blank'>" + $(this).text() + "</a>";
$(this).html(link);
});
});
Here's the link for output of JQuery script
如果你理解这些代码做什么,你应该能够毫无困难地自己做。如果你不明白代码的作用,那么这里应该首先解决一个更大的问题。 – Stephen
...你到目前为止尝试过什么? – entropic
由于SO不是代码翻译服务,因此此问题似乎是无关紧要的。 –