Custom Javascript Section Query

Custom Javascript Section Query

by Owais Sonija -
Number of replies: 1

//Adding Sign Up Button on front page

let signUpButton = document.createElement('button');

Hello! I am trying to add a sign up button to to site front page by using the following javascript code. It works perfectly fine in console but, it does not work in Custom Javascript Section. Kindly let me know the fix:

//Adding Class and Text to Sign Up Button

signUpButton.className = 'sign-up-button';

signUpButton.innerHTML = '<a href="https://courses.studyntest.com/login/signup.php?">Sign Up</a>';


//Creating Sign Up Button on front page

let signUp = document.querySelector('#pre-login-form');

signUp.appendChild(signUpButton);


Regards,

Owais

Average of ratings: -
In reply to Owais Sonija

Re: Custom Javascript Section Query

by Dominique Palumbo -
Picture of Particularly helpful Moodlers Picture of Plugin developers
Hi,

you can also customize the header or the footer of your theme ?

Regards,

Dominique.