Skip to content

Tag: javascript

conditional smooth CSS transition

Example Output JSX code Need CSS for this Example Output Answer Css: i have a div with display flex which makes img and the span align horizontally, inside my span i have a h1 and a p tag. for the h1 i have set some css properties and a transformY(10px) that means i am moving it up 10px from its

Regex to capture the group

I have a text where I want to capture email with line starting from “Email: ******” I have tried with .match(/Email:(.*)1/g) But I am getting [Email:] instead of 7c92e312-93d5-4354354-45435435@email.webhook.site How do I get the matching email from the group Answer You need to access the first cap…

react component not re-rendering after state change

It is rendering incorrectly when the page state changes I click on the category link and it checks if the link exists in category and then should set page state to category and likewise if I click on the recipe link it should set page state to recipe. The value of isRecipe and isCategory are correct but it on…

Create code template from input javascript

I’m trying to make app that generates code with HTML tags from images. User pastes an image link, image displays and after that user will click button to generate the img code to copy. I’ve got code that loads and previews images from input. I’m struggling with generating the HTML code. User…