Assign 2 Values to each radio button

前端 未结 5 1458
青春惊慌失措
青春惊慌失措 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条回答
  •  故里飘歌
    2021-01-24 19:58

    a pure js solution:

    some notes: if you pass this.value to the function then you cant access valueB anymore, pass just the entire element. To set the value use just theTargetElement.value not value and valueB ( thats just wrong ). Dont know why you ve a comma after value ( thats wrong too )

    function check(browser) {
      document.getElementById("answer").value = browser.getAttribute("value");
      document.getElementById("answerB").value = browser.getAttribute("valueB");
    }
    Internet Explorer
    Firefox
    Opera
    Google Chrome
    Safari

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

提交回复
热议问题