Skip to content

Tag: html

Moving canvas with translate() method

According to MDN documentation translate() method “moves the canvas and its origin” but the below code does not move the border of the canvas. If the translate() method moves the canvas shouldn’t the border move as well? Answer I don’t quite understand what you are trying to do. If you…

Image in span tag into an img tag

I try to display an image with <img src=”” alt=”music cover”> using <span></span> to display the music covers of my web radio. The link is dynamic, it’s why I want to use the span tag for getting the url link of the image’s shown during music playback. I&#…

How do I save the content after the onclick?

I already connected the html with js and I get the data from a form when the onclick is activated but since I save each data that I receive to use it later, how do I get the data out of the function without having problems: Answer You should create an external variable to save the data you want, when

Show and hide div in react js

How do I hide my page “section” when I click on a button. and show it another button is clicked Here’s my code how do i make the onClick event work it out? Answer Just set a state let’s call it for example hide and set default value false, and on the button click turn it to true. And y…

Hide search elements in Javascript

In the following example code I want to hide the elements that show under the search field. Code is from W3: https://www.w3schools.com/howto/howto_js_filter_lists.asp Search elements should only show when users starts typing in the search field. Nothing complex just looking for solution for beginner. Thanks A…