I need to put a link inside a div or together with a variable value coming from a function in javascript.
function getRadios(){
var radios = $("input[name='radio']:checked").val()
return radios;
}
var resultado = getRadios();
var jogar = document.getElementsById('jogar');
jogar.innerHTML = '<a href="somepage.htm?varName='+ resultado +'">click</a>';
<input type="radio" id="radio1" name="radio" value="1"/>
<input type="radio" id="radio2" name="radio" value="2"/>
<div id="jogar"></div>
I need the radio value to be inserted in the url I'm using ajax.