add an anchor tag onclick
<button onclick="myFunction()">Try it</button>
<script>
function myFunction() {
var x = document.createElement("A");
var t = document.createTextNode("Tutorials");
x.setAttribute("href", "https://www.w3schools.com");
x.appendChild(t);
document.body.appendChild(x);
}
</script>
Also in HTML:
- input types html
- html begintag
- install ubuntu in vmware
- html send email
- srcset mdn
- how to add image in html from a folder
- how To fetch the index of dropdown in html
- ionic button
- html button type
- center header html
- bootstrap 3 table
- how to make a login page in html
- radio buttons html
- html ecrire en gras
- sort by value map
- bootstrap 3 form
- html phone number input
- spring boot banner generator
- html begin tag
- html image center
- how to make a text editor in html
- vmware 12 linux
- excel vba largest value for Decimal data type
- how to change font in html