When i have the address: <link rel = "alternate" hreflang = "de" href = "..." />.
I would like to take the hreflang value from this address, meaning "de".

1 Answer 1


You can get that value with this code.

var x = document.getElementById("myLinkID").hreflang;

  • I need to get it in php
    – bambo
    Commented Aug 2, 2021 at 10:44
  • Than how your current code for setting that value? Commented Aug 2, 2021 at 10:54
  • this value is set by the external module
    – bambo
    Commented Aug 2, 2021 at 11:01
  • yes, but using which code? then we get idea how to get this in php Commented Aug 2, 2021 at 11:04

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.