Подправить код в js
5 USDДобрый день,
мне нужно подправить небольшой кусочек кода на js. Есть один javascript файл, в нем весь код.
Проблема в переключении табов. При применении этого кода -
Вылетает ошибка - Uncaught ReferenceError: openTab is not defined at HTMLDivElement.onclick
Делал по этому руководству - (https://www.w3schools.com/howto/howto_js_tabs.asp),
1) Первая часть
в html код вставляется div (это меню):
var newdiv = document.getElementsByClassName( "account-info-wrap" )[0];
newdiv.insertAdjacentHTML('afterbegin',`
<div class="tablinks feed-btn" onclick="openTab(event, 'feed')" id="defaultOpen">
<div>feed</div>
</div>
<div class="tablinks menu-btn-1" onclick="openTab(event, 'order')">
<div>Order</div>
</div>
`)
2) Вторая часть - js из урока. В скриншоте весь код (он был рабочим, до того как мне пришлось использовать insertAdjacentHTML).
Applications 1
-
12761 600 0 Здравствуйте, сделаю быстро и качественно задание, напишите в личные!
-
442 5 0 Добрый день. Могу предположить, что некоторые части кода размещены не в тех местах, либо файл с кодом подключается раньше, чем необходимо. Так же, вместо insertAdjacentHTML можно попробовать использовать более распространенную функцию, prepend(). Пишите в личку, разберемся ;)
-
2657 427 9 1 Вы там что то не так сделали, присылайте страницу разберусь что там не так
=- == -= -= -= -= -= -= -=-= - =- =-= - =- =- = -= -= -= -
-
487 9 0 Добрый день, Денис. Могу помочь вам с js`ом. Сначала я сам разберусь, протестирую, а потом объясню вам. Буду рад помочь!
-
1426 40 0 Добрый день.
Могу помочь вам с написанием табов.
Есть много вариантов
Буду рад помочь
Current freelance projects in the category Javascript and Typescript
Website design updateIt is necessary to update the design of the existing website using HTML, CSS, JS: refresh the appearance, make it modern and responsive for mobile devices. Smooth animations and interactive elements need to be added. HTML & CSS, Javascript and Typescript ∙ 3 hours 5 minutes back ∙ 51 proposals |
Consultation and audit of the current project on Odoo 19 Community EditionWe are looking for an Odoo Developer — a solo developer with experience in Odoo 19 Community Edition, including using Claude Code. We need a specialist who has successfully implemented projects in Odoo and practical experience in development using Claude Code. Important: we only… C & C++, Javascript and Typescript ∙ 8 hours 44 minutes back ∙ 5 proposals |
Online clothing storeNeed a developer for an online clothing store Looking for an experienced developer to create a full-fledged online clothing store with a drop model of sales. What needs to be done: 6 pages: home, product, cart, checkout, account, admin panel Login via Google account Cart and… HTML & CSS, Javascript and Typescript ∙ 2 days 5 hours back ∙ 96 proposals |
Full-stack development — Amazon PPC Dashboard (Stage 1)Need a full-stack developer with experience working with Amazon API to implement Stage 1 of the internal PPC dashboard. The project is real, the data is live, everything is ready to start. Frontend prototype (5 pages, React + TypeScript): WHAT IS ALREADY READY — Frontend… Javascript and Typescript, Web Programming ∙ 4 days 16 hours back ∙ 31 proposals |
Development of a photo book and photo frame constructor websiteProject Goal A modern website needs to be developed for ordering photo books, photo frames, and other personalized photo products. The main task of the project is to provide the client with the ability to independently create a ready-made layout of the product directly on the… Javascript and Typescript, Web Programming ∙ 6 days 8 hours back ∙ 98 proposals |