1

I was coding in my SharePoint with Javascript and it seems that SP10 nullify my code. I tried on here and everything is working fine, but when I change the value for the one in my code, nothing going well. Here's my code :

document.querySelector("#one").onmouseover = function() {mouseOver()};
document.querySelector("#one").onmouseout = function() {mouseOut()};

function mouseOver() {
    document.querySelector(".directeur1").className = "directeur1";
}

function mouseOut() {
    document.querySelector(".directeur1").className = "visuallyhidden directeur1";
}

And here's the HTML :

<div class="directeurs">
 <div class="directeur">
  <a class="liensDirecteur" id="one" href="/sites/gest-vpteimd/telecommunications/Pages/DSS.aspx">
   <img src="/sites/gest-vpteimd/telecommunications/BiblioDPTImage/DirecteurDSS.png" alt=""/></a>
  <p class="visuallyhidden directeur1">LOREM</p>

Thanks in advance !

1 Answer 1

0

Here's the answer ! Needed to wrap my script with

window.onload=function(){

}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.