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
1
vote
1
answer
246
views
JavaScript function for to create HTML-elements
I have written this function for creating complete HTML-elements including arbitrary attributes and inner HTML.
I want to keep and reuse it. Therefore I have tried to document the usage well.
I ...
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.
...
0
votes
1
answer
85
views
JQuery selector optimization for multiple clicks
I have multiple inputs that each one has an increment and decrement button
The buttons will be pressed multiple times so I am looking to optimize my selector:
So should I keep the first one (which ...
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:...
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 ...
4
votes
2
answers
164
views
Information about a nightclub in semantic HTML
Could anybody have a look at my HTML code and tell if it's build upon the correct semantic way using the right tags, and not using unnecessary divs?
I'm still not sure if there any divs in my code ...
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 ...
2
votes
1
answer
224
views
Sticky Table Header in Plain JS
I wrote a code for sticky/fixed table header. I am bit confused with my coding, though it does my job. I know there are many jQuery codes available online. But I wanted to do it in plain JS with IE ...
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
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 ...
9
votes
2
answers
1k
views
JavaScript Tic-Tac-Toe web app
I am teaching myself JavaScript and made a little Tic-Tac-Toe web app. I'm not asking anyone to read through it all, but to just tell me what I need or should not do in the future.
...
0
votes
1
answer
88
views
JS "Tabs" element
How can this be improved?
I'm looking particularly at the twice repeated tabButtons.forEach(button => {
...
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:
...
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
88
views
Wrting A Movie app , must be a better way
I am trying to get the value from the from and and pass it to the API and output the result to the DOM. The code works fine but I am 1000% sure there is a better way to write THIS. Thanks for the help ...