0
Adding hyperlink to JavaScript
Have an ID on HTML file, e.g. apply. How can I add an hyperlink to the ID on JavaScript instead of amending the HTML?
3 ответов
+ 2
document.getElementById('abc'). innerHTML = '<a href = "your_link">abc</a>';
0
Thanks! But having this error “Uncaught TypeError: Cannot set property ‘innerHTML’ of null”, how can I debug?
0
Use :
onload=()=>{
// your code here
}