Srdjan Srdjan -4 years ago 110
Javascript Question

Placing logo with Javascript

I have used following code to place logo on my site wpbarbers . com.
Everything works fine in Mozilla and Chrome but Internet Explorer and Safari are not showing logo.

Thanks for tip!

(function() {
var logoHere, logoMain, text;
text = document.querySelector(".header .header-inner .logo a");
text.innerHTML = "";
logoHere = document.querySelector(".header .header-inner .logo a");
logoMain = document.createElement("img");
logoMain.setAttribute("src", "");
logoMain.setAttribute("height", "143");
logoMain.setAttribute("width", "300");
logoMain.setAttribute("alt", "WP Barbers");

Answer Source

Use appendChild not append. append is experimental and not what you are looking for in this case.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download