User:Srinibha23/click.js

// Check if the existing panel exists var panel = document.querySelector('.mw-ge-help-panel-home-button-general-help'); if(panel) { // Create the new element var aiChatBotElement = document.createElement('div'); aiChatBotElement.classList.add('mw-ge-help-panel-home-button'); var textDiv = document.createElement('div'); textDiv.classList.add('mw-ge-help-panel-home-button-text'); var header = document.createElement('h2'); header.classList.add('mw-ge-help-panel-home-button-text-header'); header.textContent = 'AI Chat Bot'; var subheader = document.createElement('div'); subheader.classList.add('mw-ge-help-panel-home-button-text-subheader'); subheader.textContent = 'Search for answers and interact with the chat bot'; // Append header and subheader to the textDiv textDiv.appendChild(header); textDiv.appendChild(subheader); // Create the image span var imageSpan = document.createElement('span'); imageSpan.classList.add('mw-ge-help-panel-home-button-image'); var imageIconSpan = document.createElement('span'); imageIconSpan.classList.add('mw-ge-help-panel-home-button-image-icon'); imageIconSpan.classList.add('mw-ge-help-panel-home-button-image-icon-ai-chat-bot'); imageIconSpan.classList.add('oo-ui-widget'); imageIconSpan.classList.add('oo-ui-widget-enabled'); imageIconSpan.classList.add('oo-ui-iconElement'); imageIconSpan.classList.add('oo-ui-iconElement-icon'); imageIconSpan.classList.add('oo-ui-icon-chatBot'); imageIconSpan.classList.add('oo-ui-labelElement-invisible'); imageIconSpan.classList.add('oo-ui-iconWidget'); // Append imageIconSpan to the imageSpan imageSpan.appendChild(imageIconSpan); // Append textDiv and imageSpan to the aiChatBotElement aiChatBotElement.appendChild(textDiv); aiChatBotElement.appendChild(imageSpan); // Insert the new element after the existing panel panel.parentNode.insertBefore(aiChatBotElement, panel.nextSibling); }