Reputation: 41
<div className="col-lg-3 col-md-3">
<li>
<img src='https://i.imgur.com/fe0T4nw.png' onClick="https://arizonaatwork.com" />
</li>
</div>
In my project I am importing an image and on the onclick I want the image to take them to a URL. How can I get this done?
Upvotes: 4
Views: 25184
Reputation: 343
Working example: You need to add "a" tag before image
<div className="col-lg-3 col-md-3">
<li>
<a href="https://i.imgur.com/fe0T4nw.png"><img src='https://i.imgur.com/fe0T4nw.png' onClick="https://arizonaatwork.com" /></a>
</li>
Upvotes: 0
Reputation: 516
You can use a
tag:
<li><a href='https://arizonaatwork.com'><img src='https://i.imgur.com/fe0T4nw.png'/></a></li>
Upvotes: 5