Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Onclick on button is not working in ReactJs

I am working with Reactjs (Nextjs),I put my "css,images,js" files in "public" folder,But my
Menu bar is not showing (onclick is not working),How can i make this working so after click on this button menu will display,Here is my code

<button className="openbtn" onclick="openNav()">
        <img src="images/menu_btn.png" />
</button>

>Solution :

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

You are sending a string to onClick function, so change your onClick button to this,

onClick={ () => openNav() }
Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading