This is my js code :
<script type="text/javascript">
var url = window.location.protocol + "//" + window.location.host + _spPageContextInfo.webServerRelativeUrl;
var pngPath = '/_catalogs/masterpage/assets/tools-banner.jpg';
var elem = document.createElement("img");
elem.src = url + pngPath;
elem.setAttribute("alt", "Banner");
document.querySelector("#banner").appendChild(elem);
</script>
when i test it in the browser console it work just fine , but when i put it in the of my master page it doesn't work should i load jquery? any solution ?