Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

javascript radio button value if checked

//alert(document.querySelector('input[name = "comp"]:checked').value);

$test=document.querySelector('input[name = "comp"]:checked').value;

if($test="silver") {
        amount=50;
    }else if($test="gold") {
      amount=90;
    }else{
      amount=30;
    }
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #javascript #radio #button #checked
ADD COMMENT
Topic
Name
8+1 =