i am rendering a select box using Ajax call in php and the output is coming like
<select onchange = 'addtolist(this.val)' name='select_val' id='select_val' class= 'required'>
<option value='xzvfxcv'>xzvfxcv</option>
<option value='dfscs'>dfscs</option>
</select>
ok and here is my function addtolist
function addtolist(id){
alert(id);
}
now while changing the select box i am getting the undefined
please help me out out what might i am doing wrong ?
valis not valid attribute of javascript element you have to usevalueinstead,Live Demo