js -> Get another attribute value through one attribute value of the tag

 

 

according to 

 

<link rel="search" type="application/opensearchdescription+xml" href="/opensearch.xml" title="GitHub">

 implement

 

 

document.querySelector("link[rel=search]").getAttribute("href")

 

 

You can get /opensearch.xml

 

refer to: 

 

https://stackoverflow.com/questions/9441928/how-to-get-attribute-from-a-link-tag-in-pure-javascript

 

Supported Browsers 

http://caniuse.com/#feat=queryselector

 

 

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=326613731&siteId=291194637