Questions tagged [dom]
The Document Object Model (DOM) is an application programming interface (API) for valid HTML and well-formed XML documents. It defines the logical structure of documents and the way a document is accessed and manipulated.
403 questions
8
votes
2
answers
362
views
Library project - javascript
I am going through the Odin Project and have just finished the 'Library' project on their FullStack JavaScript course. As this is the first time I'll have my code reviewed, I want to know what I'm ...
6
votes
1
answer
117
views
Code for smart CSS rounding using JavaScript
I wrote a project that allows you to make CSS corner rounding more consistent and, in my opinion, nicer. Here's full GIT repo with an example and a README.md: https:...
4
votes
3
answers
279
views
Get the contents of a table cell for all selected rows
I have a table of user info. When you click the button, I want to get the email address from each selected row, output into a comma-separated string.
I got it to work with the following code, but I'm ...
4
votes
3
answers
2k
views
Increment counter on button click
I've written a simple JavaScript function to increment a counter after clicking on a button.
Here's my code:
...
4
votes
2
answers
1k
views
JavaScript front end for Odin Project book library database
I am currently working on The Odin Project and have reached the JavaScript Part. There is a project, to create a Website that serves a a library. You can add a book and it appears on the site as a ...
2
votes
1
answer
844
views
jQuery code to add / remove classes depending on the button clicked
What the code does
What the JQuery code does is add / remove classes on div's elsewhere on the page, depending on the button clicked.
Button 1 clicked → add class ...
2
votes
1
answer
1k
views
Animating GIF on hover in Javascript
I don't know JavaScript and it's safe to say this is my first code ever written in JS.
I just needed to animate my GIFs when user hovers over them only.
Googling separate concepts such as "string ...
5
votes
3
answers
646
views
Refactor JavaScript nested if-else
I'm really new to code optimization and JS. I would like to ask for help on optimizing my code. Thank you in advance.
Here is my code:
...
3
votes
0
answers
130
views
Splash screen library in jQuery
I have created a splash screen library in jQuery. The splash screen will display until the website has completed loading all the images. I just wanted to know if there are any possible improvements.
...
3
votes
1
answer
420
views
Unit test for a React click-counting component
Take this basic component using state:
...
0
votes
0
answers
97
views
DOM manipulating that I called Framework
I'm building a framework like this that can turn SASS-like code into CSS, a template engine like Mustache, a DOM manipulator like React, and a router to add a single page app, and I'm having a ...
0
votes
1
answer
393
views
Remove columns in HTML table where the sum is 0
I have an HTML table, and I would like to remove columns where the sum vertically is 0 dynamically.
...
0
votes
2
answers
2k
views
Sort table with ascending or descending order without a library
This is my first day coding, and I need help with sorting a table in ascending/descending order. The idea is that when a column is clicked it will sort in ascending order, and then it is clicked again ...
0
votes
0
answers
81
views
Enable a textbox when the previous one is no longer empty
I've written this JavaScript code, which disables textboxes if the previous textbox is empty. This is so people enter the text in order — write first in the first textbox, only then the second textbox ...
7
votes
1
answer
460
views
Find and replace text in a webpage with JavaScript
I am new to web development and would like to get feedback on a JavaScript library that automatically finds and replaces text on a webpage using the MutationObserver interface.
EDIT: Seeing that this ...