skip to Main Content

How to navigate to a url in class Component – Javascript

import React, { useState, useContext, createContext } from "react"; import { Link, Redirect } from "react-router-dom"; export class Login extends React.Component { constructor(props) { super(props) window.data_login_callback = this.data_login_callback this.data_login_callback = this.data_login_callback.bind(this); } state = { brand: "" } rend(props){ console.log("ddd",props)…

VIEW QUESTION

Add a class to all sibling element if one of the element gets that same class when clicked? – Javascript

const images = document.querySelectorAll(".img_items"); images.forEach((image) => { image.addEventListener("click", () => { image.classList.add("select"); }); }); .img_items::after{ content: ' ' attr(class) } <div class="img_container"> <div class="img_items ">1</div> <div class="img_items ">2</div> <div class="img_items">3</div> <div class="img_items">4</div> </div> I tried adding the class to the…

VIEW QUESTION
Back To Top
Search