My js gets the value of the option option in the select tag. Why is it always the first value? The other choices still get the value of the first one.

clipboard.png

,0,0

clipboard.png

Mar.20,2021

your way of writing must only be the default when you get it. The value of val will change


only if you get the value of val when you are in change.

would you please express your opinion if you step on the answer?

< hr >

the reason must be that you tampered with the unposted code

<!DOCTYPE html>
<html lang="zh">
<head>
    <title>Title</title>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body>
<select id="sutate" data-options="panelHeight:'auto',editable:false" name="sutate">
    <option value="0">1</option>
    <option value="1">2</option>
</select>
</body>
</html>

run result:

clipboard.png

that's what it's called about select. That's all.

if you really don't know which code affects your code that should be normal, there is a good way to troubleshoot it, which is troublesome, but effective:

is to copy your normal code separately into a new html to see if there is a problem. If there is no problem, add other code from your original page to the new html step by step to know which code has affected it. Yours, however, is most likely to be the following:

1, there are several id=sutate elements
2, there is code dynamically changing the value of select
3, unexpected, for thousands of reasons

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b336f1-2b6e6.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b336f1-2b6e6.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?