so i need a button to change an image then it is clicked but to also change a certain text. to do so I require two onclick functions. how do I do this? this is my code so far. so I can change the images when the buttons are clicked but I cant make the text change as well. Answer
Tag: css
How do I set two div which are side by side to scroll independently?
I have one main parent div. Within that there are two divs, left and right. I was able to make the left and right div scroll independently. However, within the right div, there are again two divs (1 and 2). I am trying to make 1 and 2 scroll independently. The scroll is happening within the entire right div o…
How to add style for specific words at HTML using JavaScript?
Could someone help me to write JS function which will take a string(word) as an argument? And then add an additional style (change color for example) for all these words in the HTML. I don’t know where it is located. This “word” can be inside <div>, or <p> or even <b>. Exam…
Problems in Making RPS Game Using HTML, CSS, Javascript
I’m making a rock, paper, scissors game, but it seems doesn’t work well. I’ve tried looking for mistakes though I can’t find any. When I click the image, it doesn’t pop out as well as the text/message. The console said: Could you please help me correct them? I really appreciate y…
Why does window.getComputedStyle(element).getPropertyValue(“order”) doesn’t returns order of a flexbox element?
From MDN Web Docs: “window.getComputedStyle() method returns an object containing the values of all CSS properties of an element, after applying active stylesheets and resolving any basic computation those values may contain.” Window.getComputedStyle() returns a CSSStyleDeclaration object which co…
Filterable gallery using slick.js
I’m trying to create filterable gallery with differents buttons but when I click on them the filter is working but that let empty space in the gallery for the other pictures. I tried to use different script from the forum but that always let empty space. This is an exemple of the HTML : And the JavaScri…
React inlined SVG paths are not responding to css animations
I uploaded my code and svgs to this github repo. I have some svgs of some circles, blobs and triangles. I am trying to make the circles shake, like how the guy shakes in this code pen when you hover on him, I am trying to make the blobs move like waves like in this code pen, and I’m trying
html5/css/javascript : How to superpose two canvas in a div
Hello I’m stuck on a superposition problem of two canvas. Here is a simplified example. Note that in the real application, buttons and drawings are far more complicated and that I want to keep the structure with html5 / css / javascript. I suppose that I miss something in the css to succeed to have thes…
Change CSS style of an element after user click on an area of an image
The area is defined by using map tag. There is also a paragraph above the image. When the user click on the image area, the color of the paragraph will change. Any idea how to do this with javascript? For example, this is the html Answer To change the style of the <p> tag when you click on the area
Javascript change webkit style with variables
Summary I’m working on an input[type=range] that essentially looks like Chrome’s default but the thumb is green until clicked. That’s the end goal. Through a couple answers that are now buried deep in my browser history (hence lack of credit to them) I am able to get it MOSTLY working how I …