Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

115
Views
i want to show a different image when button is clicked

i need to make it that when i click the button an image is replaced by another

HTML:

function Show1(){
        if(Clicked === false) setClicked(true);
        else setClicked(false);
        console.log(Clicked)
    }




<div className="SignIn__AsWhat">
          <button className="SignIn__AsStudent" onClick={Show1}> 
          {Clicked === 0? <"What do i put here"/> : <"and here?"/>}                
          Je suis étudiant
          </button>
              <button className="SignIn__AsTeacher">
              Je suis enseignant
              </button>
          </div>
about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

function Show1(){
    setClicked(!Clicked)
}


<div className="SignIn__AsWhat">
      <button className="SignIn__AsStudent" onClick={Show1}> 
      {Clicked? <img src="https://lh6.googleusercontent.com/-aepjQbk-blQ/AAAAAAAAAAI/AAAAAAAAAAA/ACHi3rc0BHkpnTpc2qD0-hwjIvLM-8o8BQ/mo/photo.jpg?sz=48"/> : <img src="https://i.stack.imgur.com/Izu1b.jpg?s=64&g=1"/>}                
      Je suis étudiant
      </button>
          <button className="SignIn__AsTeacher">
          Je suis enseignant
          </button>
      </div>
about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!