I’m working on a complex multipage form using HTML, Bootstrap and JavaScript. What I’m trying to figure out is to validate each section of the multipage form and check if all required fields (if any) are actually valid so that the user can proceed to next section in the form. The following code sn…
Tag: html
Is it possible to invoke sound from the JS file in Django’s HTML template without Ajax?
I’m in the middle of migrating a site to Django framework. Almost all JS scripts works, except those related to sound. I have a play/pause button for a song and some sounds invoked when the mouse is hovering over particular buttons. For just those files I received from the console: Of course, those file…
Django and JS for loop: how to change a variable value into {%static ‘path’ %}?
I’m trying to find out how to change a path in a picture having JS logic in the Django template. As an example – according to logic in the JS script – change from: hangman_game/img/s0.jpg to hangman_game/img/s1.jpg then to hangman_game/img/s2.jpg ect In the previous framework, it was working…
React Using addEventListener(“scroll”, function()) and useState shows no transition
I want to change background color of navigation gradually with transition like this Article.js Article.css When I run these, class name ‘active’ is added to the [div] but its background color is changed quickly from rgb(248, 249, 250) to rgb(255, 255, 255). I think this is because addEventListener…
Capture value from an input with svelte
I’m trying to capture the value of an input using the svelte framework When initializing the local environment I already get the following error in the console: Uncaught TypeError: Cannot read properties of null (reading ‘value’) Visual Studio Code marks the code snippet .value when I try to…
How to clamp/unclamp blocks of text in jQuery or Vanilla JS?
I can’t figure out how to do the following in jQuery or Vanilla JS. For the layout below I want to do the following: Compress each text block using multi-clamp library to three (3) lines. When you click on the “Read more” button or on the block itself, that block of text should “expand…
Create element inside another based on id
rigth now I have this code to draw some divs (based on some logic I’ll have parent and childs. So, my question is: if there is a way to get the parentDiv and draw inside the X childs elements and how can I do it? I tried with this: But I’m getting the .appendTo() is not a function error message.
How do I separate the HTML markup in my custom element?
I have a custom element that displays a message inside three nested divs: It works, but I’m not happy with having all of the HTML markup inside of strings. I want to separate the HTML markup from the JavaScript, preferably in a separate file so that my IDE can give me better support. Here’s an exa…
Website Refreshes After Clicking Button JavaScript [closed]
Closed. This question needs debugging details. It is not currently accepting answers. Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question. Closed 7 months ago. Improve this question When…
After executing a function style is no more displayed
I need to display some boxes, however when I activate the function to order them the padding between each box desappears. Do you know how to fix this? There is also some css code for the style of the list. But when i execute the function mia_posizione the padding between the boxes is canceled and they are dis…