Button in TopBar

I try your code to add a button, but i still can see any button on the top bar

<script id="clockScript1" type="text/javascript">
 var home = new Object();
 home.payload = 'Déconnexion';
 var language= new Object();
 language.payload = 'change';
 var theScope = scope;
 var clockInterval;
 $(function () {
 if (clockInterval) return;
/*
 //add logo
 var div1 = $('<div/>');
 var logo = new Image();

 logo.src = '/wieland_logo.jpeg'
 logo.height = 45;
 div1[0].style.margin = '10px auto';

 div1.append(logo);
*/
 /*//add clock
 var div2 = $('<div/>');
 var p = $('<p/>');

 div2.append(p);
 div2[0].style.margin = '5px';
 

 function displayTime() {
 p.text(new Date().toLocaleString());
 }
 
 clockInterval = setInterval(displayTime, 1000);

 // add Text
 var div4 = $('<div/>');
 var t = document.createTextNode("TRAINING"); // hier den Title eingeben
 div4.append(t)
 div4[0].style.margin = '40px auto';
 div4[0].style.size = '40';*/
 
 // add button
 var div3 = $('<div/>');
 var button = document.createElement("BUTTON");
 var b = document.createTextNode("Déconnexion")
 //var logo = new Image();
 //logo.src='/sprache.png';
 //logo.height=45;
 //button.appendChild(logo);
 button.height=45;
 //button.left=50; 
 button.appendChild(b);
 button.addEventListener("click", doIT.bind(null, home));
 div3.append(button);
 
 //var div5 =$('<div/>');
 //var taster = document.createElement("Button");
 //var pic = new Image();
 //pic.src = "/home.png";
 //pic.height=45;
 //taster.appendChild(pic);
 //pic.addEventListener("click", doThis.bind(null,language));
 //div5.append(taster);
 
 //add to toolbar when it's available
 var addToToolbarTimer;
 
 function addToToolbar() {
 var toolbar = $('.md-toolbar-tools');
 
 if(!toolbar.length) return;
 //toolbar.append(div5);
 toolbar.append(div4);
 //toolbar.append(div1);
 toolbar.append(div3);
 //toolbar.append(div2)
 clearInterval(addToToolbarTimer);
 }
 addToToolbarTimer = setInterval(addToToolbar, 100);
 
 function doIT(m){
 theScope.send(m);
 }
 
 function doThis(m){
 theScope.send(m);
 }
 });
 
</script>

Hello,

how do i reset the changes of the script?

i cant get rid of the elements that are now on the toolbar :slight_smile:

Greetings
Chorum