How to display alert message box on RadioButton click in jQuery?
When i click on RadioButton need to display the value in JavaScript alert message.
Hi makenzi.exc,
Use the jQuery click event this way.
Refer below example.
HTML
<html> <head> <meta charset="utf-8" /> <title></title> <style type="text/css"> body { font-family: Arial; font-size: 10pt; } </style> </head> <body> <script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.7.1/jquery.min.js"></script> <script type="text/javascript"> $(function () { $("input[type=radio]").click(function () { alert( $(this).val()); }); }); </script> Do you have passport? <input type="radio" name="passport" value="Yes" />Yes <input type="radio" name="passport" value="No" />No </body> </html>
Demo
Screenshot
Downloads
Download Sample
© COPYRIGHT 2025 ASPSnippets.com ALL RIGHTS RESERVED.