first of all, I can not use the “create-react-app” command in the current project. so here I am trying to add my react code into a plain HTML file. Here are my codes for HTML and js files. can anyone tell me why my hooks and setState don’t work properly? Please guide me to solve it. my like_…
Tag: html
Splitting an Ordered List into two columns
So I have been trying to split my ordered list, which contains skill names, into two columns, but the columns are not on the equal level. I tried to fix it by adding padding and margins as such, but it doesn’t work. Here’s my code – The Output – Contains output of given code snippet as…
How to replace text with a random array element?
I am trying to replace text with a random element in my array. When the user clicks on the text itself, the word should change to one of the elements in my array. I am having trouble with the function that lets me do so. I have text and wrapped span tags (named “hare”) around words that I want to
how to change with javascript
I have a Javascript function that I been dealing with for a few hours, Javascript: HTML: CSS: The <li> tag is meant to act as a button, and it does everything in the function, (changes .svg Icon and plays the music) but the second time I click it again, nothing happens. I also checked the console, and n…
Image hover animation bug on Robin Dela Hover Effect with GSAP CDN
I applied a simple transition effect with the “Robin Dela Hover Effect” plugin. Although it only works fine with TweenMax and ThreeJS cdns, if I add the GSAP cdn the animation turns into an error. When you swipe the mouse over the picture from left to right, it displays the other picture a few sec…
How to access elements of one html in another html file using their id
I have created two html files ( file1.html and file2.html ). In file2, I have 10 paragraphs each having a unique id . How can I access these paragraphs using their id in file1. Answer This can be solved with Javascript using the .getElementById method. This can be accomplished via localStorage. Below are step…
How to move an object over half-circle from start to end?
I have a half-circle (green) and an object (blue). I want to move that object on that circle from start (left) to end (right). The object should follow the path (black) of the half-circle. Object should move based on specific value. Value is a number from 0 to 1. Start = 0, end = 1. My current solution: trans…
Why I can not call method of WebComponent?
I wonder why I cannot call a method defined in web-component if I attached this component via .append instead of using tag name inside the template. Below I am providing few examples. One is not working(throwing an error). I wonder why this first example is throwing this error. Example 1 In this example, I am…
The value in my number input won’t change with user interaction [closed]
Closed. This question needs to be more focused. It is not currently accepting answers. Want to improve this question? Update the question so it focuses on one problem only by editing this post. Closed 1 year ago. Improve this question I am trying to multiply the value that the user will choose from the input …
Cannot access element after creating it with append child
I am trying to create a chess game using html and js. Here is part of my HTML code: Here is the JS Everything works fine but the problem is when I use append child to copy image , I can no longer select the copied image. I can still select original one. Answer The problem is that you are