I was trying to complete project on fcc.Didn’t know how to add quotes in html.Looked up in their premade project found this piece.Can someone explain what is going on in this code? Answer It’s a hack to get around an incorrect Content-Type. gist.githubusercontent.com isn’t designed to host J…
Tag: html
Modifying attributes and texts that follow simple patterns
Here is my initial unuseful code. I would like that the browser works with the following code for the body where [[ … ]] has been cut, and {{ SOMETHING }} is become <span style = “color: red;; font-weight: bold;”>SOMETHING</span>. I have no control on the DOM structure, and the p…
why do these similiar functions not work?
I have some divs and if i hover them I want an popup to show. I have six divs and six popups to show but not all at once instead only one per one. The first function works fine but then the other do not work how can I move them all to one snippet? Answer okay so actually i
target child div of ID in JavaScript and CSS
I’m having difficulty targeting the child div of id=”videoContainer” and changing its style Answer You can use querySelector with the direct child operator > (and maybe first with :first-child if you have more than one child div) like this: object-fit: contain will force you video to scal…
How to make the FAQ accordion toggle?
I’m trying to make an FAQ accordion and I want it to have two main features: 1- one question and answer can be seen at a time (I managed to do that) 2- if toggling on the open question it closes, and vice-versa (that’s what i’m struggling with) Here’s a pen that has a small copy of wha…
Getting JavaScript file from Google Sheets
In my google sheet I entered below formulas in B1 and B2 Then these Cells become valid JS statements name = ‘Prabhu Paul’ ; and city = ‘India’ ; Then I published the Sheet in .csv format, below is the URL. And now I used this URL as the source file for my Script. The script added to si…
How can I prevent click handler action on the whitespace around an SVG path?
I have this image here which is SVG format, when the user clicks this image some action happens. One problem there, this image has some white empty space around it that can’t be removed because it’s not a quadrilateral. What I need is when the user clicks this empty space around the image don̵…
Trying to figure out why my quiz isn’t registering my answer when submitted
So at the moment, the quiz keeps looping through the quiz until it switches to the endQuiz Function. What I am trying to do is determine if the answer is equal to the ID in the array when it has been checked, so I callback to the function called selectedAnswer. So when I can call back to it later in
how do I make elements not move when other elements do?
i have some image elements that when hovered on, scale up, however, this causes some other elements to move, which i dont want happening. I have tried things like float: right which work, but dont fit for my website, since it’s margined and centered. here is a simpled version of my site: Answer Use tran…
“TypeError: db._checkNotDeleted is not a function” when creating a db Ref on Firebase
I’m working on a web app in html (and vanilla JS) that uses firebase for checking and updating values on a Realtime Database, I keep getting a lot of errors but still can’t figure out what I’m getting wrong. I’m sorry I’m new to JS and firebase. Relevant html code (table inside f…