How to change option text and value of select type using JS

 


 
function changeContent(){
     var opt= document.getElementById('test').options[0];
     opt.value =  'box';
     opt.text = 'box';
}

Comments

Popular posts from this blog