Assign value to the select drop-down box --- set the text of the selected option in the drop-down list

From , 5 Years ago, written in JavaScript, viewed 186 times.
URL https://pastebin.vip/view/cbf22ab2
  1. var x=document.getElementById("province");//获得节点
  2. x.options[x.selectedIndex].text=data["province"];//节点选中项的值为data["province"]
  3.  
  4. //知识点连接:http://www.w3school.com.cn/tiy/t.asp?f=hdom_option_settext
  5. //心得:看最原始的资料,一定可以找到答案

Reply to "Assign value to the select drop-down box --- set the text of the selected option in the drop-down list"

Here you can reply to the paste above

captcha

https://burned.cc - Burn After Reading Website