Ram has designed a portal with 'like' and 'unlike' image buttons that redirect to 'thanks.html'. Which HTML code correctly implements this?
Answer options
A
<form action="thanks.html"> <input type="submit" src="like.jpg"/> <input type="submit" src="unlike.jpg"/> </form>
B
<form action="thanks.html"> <input type="image" src="like.jpg" alt="submit"/> <input type="image" src="unlike.jpg" alt="submit"/> </form>
C
<form action="thanks.html"> <img href="like.jpg" value="submit"/> <img href="unlike.jpg" value="submit"/> </form>
D
<form action="thanks.html"> <input type="submit"> <img src="like.jpg"/> <img src="unlike.jpg"/> </input> </form>
Correct answer: <form action="thanks.html"> <input type="image" src="like.jpg" alt="submit"/> <input type="image" src="unlike.jpg" alt="submit"/> </form>
Explanation
The correct approach uses <input type="image"> which creates a clickable image submit button. The src attribute specifies the image, and the form action redirects to thanks.html on click.