本文介绍了如何从超链接获取URL的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
大家好,我是一个使用Javascript的初学者,我想知道如何在变量中获取超链接的url?我想做一些像mozilla(不是吧)状态栏的东西,但只要获取网址,无论超链接的扩展名(.html,.php,.pdf等)。所以,我需要你的帮助:)。谢谢
Hi everybody, I''m a total beginner using Javascript and I would like to know how can I get in a variable the url of hyperlinks? I want to do something like a status bar of mozilla (not a bar) but just get the urls no matter the extension of the hyperlinks (.html, .php, .pdf, etc). So please I need your help :) . Thanks
推荐答案
欢迎来到TSDN!
有一个标签的属性href。
试着访问这个。
有一个例子。
Welcome to TSDN!
There is an attribute href of a Tag.
Try to access this.
Have an example.
展开 | 选择 | Wrap | 行号
HTML页面上包含所有< a>名称为links的标签
on a HTML page with all the <a> tags with the name "links"
这篇关于如何从超链接获取URL的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!