xxxxxxxxxx
onclick="location.href='http://www.hyperlinkcode.com/button-links.php'"
xxxxxxxxxx
<a href="http://www.google.com" onclick="return myFunction();">Link</a>
function myFunction() {
document.getElementById(".myDiv").style.flexGrow = "5";
}
xxxxxxxxxx
<a href="#" onclick="myFunction()">Click me</a>
<script>
function myFunction() {
// Add your code here
console.log("Anchor tag clicked!");
}
</script>
xxxxxxxxxx
$("#myHref").on('click', function() {
document.getElementById(".myDiv").style.flexGrow = "5";
window.location = "http://www.google.com";
});`
xxxxxxxxxx
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" />
<button class="btn btn-success">¿Soy un botón o un enlace?</button>
<a href="www.google.com" class="btn btn-success">¿Soy un botón o un enlace?</a>
EjecutarEsconder resultados