function def()
{
    var key = document.getElementById ('selectarea'); //select list

    var value = document.getElementById ('DocAuthor'); //input text

 

  //两种不同的取值


    value.value = key.options[key.selectedIndex].text; //取得select list已选项的文本(显示给用户的值)赋给input text

    value.value = key.options[key.selectedIndex].value; //取得select list已选项的value(正真传递的值)赋给input text
}

相关文章:

  • 2022-03-09
  • 2021-10-24
  • 2021-08-04
  • 2021-07-24
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-01-02
  • 2022-12-23
  • 2021-08-20
  • 2022-12-23
  • 2021-11-17
相关资源
相似解决方案