+ 3

Js

can I create an js code and get href ?

21st Dec 2017, 5:48 PM
SodoDeve
SodoDeve - avatar
3 Antworten
+ 5
See it's Please ↓↓↓ :) <html> <head> </head> <body> <script> var a = document.createElement('a'); var linkText = document.createTextNode("my title text"); a.appendChild(linkText); a.title = "my title text"; a.href = "http://example.com"; document.body.appendChild(a); </script> </body> </html>
21st Dec 2017, 5:52 PM
James16
James16 - avatar
+ 3
Hope you are looking for something like this use - var href = window.location.href :)
21st Dec 2017, 5:51 PM
💻Amey💻
💻Amey💻 - avatar
+ 2
all right
21st Dec 2017, 5:53 PM
SodoDeve
SodoDeve - avatar