Use <a href> link and <onclick> function together

$("#myHref").on('click', function(event) {
    event.preventDefault();
    document.getElementById(".myDiv").style.flexGrow = "5";
    window.location = "http://www.google.com";
});

But you won’t see the effect when you’re immediately redirecting anyway.