I have this code which in jQuery:
$(document).ready(function() {
$(".link.auto_open").prop("href", "http://newlink.com/");
$(".link.auto_open").html("Need inspiration?").fadeIn(600).css("display","inline-block");
});
-- but I need to implement this in a site which is not using jQuery. How can I change this code to native javaScript?
This is what I have tried:
<script>
var x = document.getElementsByClassName("link.auto_open");
x.setAttribute("href", "http://newlink.com/");
x.innerHTML("Need inspiration?");
</script>
but it's not working