Assign 2 Values to each radio button

前端 未结 5 1457
青春惊慌失措
青春惊慌失措 2021-01-24 19:56

I\'m trying to assign 2 values to each radio button, to output in 2 fields. But it doesn\'t work. Here the code im using:

5条回答
  •  旧时难觅i
    2021-01-24 20:01

    You have a few different issues here. First, the answerB text field needs to have its value set, not valueB set. Second, you are setting both to the same value. So, instead of passing this.value into the check function, just pass this. Then you can use .getAttribute('valueB') to access your custom property.

    Also, don't put commas in html tags. I removed those from your tags.

    See below:

    
        
        
        
        
        
        
        

    What's your favorite browser?

    Internet Explorer
    Firefox
    Opera
    Google Chrome
    Safari

    PC Min Ram Requirement is: Mac Min Ram Requirement is:

提交回复
热议问题