Articles → HTML → Difference Between Id And Name In HTML

Difference Between Id And Name In HTML






Difference





Example




<!DOCTYPE html>
<html lang="en" xmlns="http://www.w3.org/1999/xhtml">

    <head>
        <meta charset="utf-8" />
        <title></title>
    </head>

    <body>
        <form>
            <input type="text" name="test" value="1" />
            <input type="radio" name="Gender" value="Male" />Male
            <input type="radio" name="Gender" value="Female" /> Female
            <input type="submit" value="Click Me" /> </form>
    </body>

</html>

Try It



Picture showing the sample web page displayed on the browser
Click to Enlarge



Picture showing the value of selected radio button passed as querystring in the URL
Click to Enlarge




Posted By  -  Karan Gupta
 
Posted On  -  Thursday, July 13, 2017

Query/Feedback


Your Email Id  
 
Subject 
 
Query/FeedbackCharacters remaining 250