Are you asking in php or javascript.
If it is in php, give the name of that and use the post or get method, after that you can use the option of isset or that particular button name is checked to that value.
If it is in js, use getElementById for that