Skip to content

Tag: dom

Very Simple HTML/JavaScript Button Not Working

What should be an incredibly simple button is not working. All I want is for it to log something to the console for some testing purposes, but it refuses to work. There’s the button in my HTML file, and below is the JavaScript that, as far as I can tell, should be working. All I want is for the button

How to add a class to the body element in javascript?

So I wanted to code a simple thing in javascript, I have a responsive navbar with the hamburger button: I wanted to halt scrolling whenever the hamburger menu is active. So I wrote this javascript code: And of course I added .noscroll{ overflow: hidden; } to the css file. It didn’t work for some reason …

Need to select text of selected dropdown using JavaScript

I have a dropdown with values. I have an array array with a list of values that will match the drop down values. If the value of text option of the dropdown exists in the array, it shouldn’t show in the dropdown as an option. I am stuck on the approach I should use. This is what I have so

Render vue component in data

I trying to make custom tooltip for apexcharts like in example: https://apexcharts.com/docs/options/tooltip/# and it’s works, but when I set in return some vue component nothing shows. Why is this happening and how to fix it? Answer To make Vue render the component correctly, you’ll have to tell i…

js DOM divs manipulation problems

I am currently learning DOM, and found the following task quite hard to complete in an proper manner. The js code is supposed to: append new divs, as a continuation of the existing ones, remove the existing divs, change colour of one div, switch all div’s text content. My issues: Task 1. works but in a …