I am currently working on a school project and one of my functions is not running, onclick. I dont know why. I know its the function because i added a console.log() command.
HTML:
<div id="popup">
<div id="contain">
<div id="advert"><a href="#" onclick="close()" id="close">close</a></div>
</div>
<div id="block"></div>
</div>
JS:
function close(){
console.log("worked");
$("#popup").hide();
};
close()as a global is already taken by the browser. Try renaming the function toclosePopup()or similar to avoid the conflict.