如何用js获取多组单选框/复选框/下拉框的值?(三种框同时存在于同一页面)

我一直都不太会获取多组单选框/复选框/下拉框的值,也不太清楚如何判断数据库中哪个复选框被选中。求高手指导。

不了了之lgm
浏览 2449回答 2
2回答

拿不到钥匙的车放不进手机的歌

getElementById就可以了 对应的你的单 复 下拉框要有对应ID

慕瓜9220888

GXFAYBRGTKRFUMVYVRLVHCSVOUXAOWVYBAHAYPXCEULYHZQIQPFYENWNSBZPPRLRONVJDMVFAEGUZYEUFVDRJSYXKDIFUPHLEXJWMBQLXKWMYZKMHKQZJBAYNFEEENIJOMBRHDCUPNDSBROFKODITJMJZNCUJHAXATUVWFTWSILUEWUJFIHHMWYMBOXXYSPRPKGJMVERTOMCXGTXIMLZZMILHLCBGRQAZRQWGXMWVMZGBGHOKKZUVAFTGMPIRIWRQZMHAELXONZVSLGAIEQLUUKWDIWFYUDMQXCDYKKNMXIWIAPYSHDAZAWFRASQGLUMSEKDVZIDQQEAWLKZHZSYRHFCXWXKMCFWHUMETJJCGACKFLUHMSGYCUADJWGHMAPQGZITUFXLOLHDWQVUBHWFSCGRDIIYRNWAIGBLADJKCRNJTMGBLAJEWVIXRTAVJIBNJBRYGBJWIYLBAMRPIGZJRCXVKZCICKVZIMWFEHRSHFHGGUDSNSQYHNWTFAYTYRRQQBYKIGWMLIARMLCZYJMGHCUZSCLGXEXLRYJQNUQDLXBVYBVUTVQRGJPHYNYXJZZCNWYQERKWDYZOJBKUJGPTIGPYEXATKFVUXTWZQKCQPCLKQYZXMTCFOVBJXFENTCVSZWVWCVVOKRZYOKHNGPTLAIUXXGKLAVJMPFYQUZBMZOYNAPQSXDWYIFMLQOEYIIZGOTYLAQZDUMHJZMLDXLKLQWWIBJUCSQGMCOZUZLBYYVTDUPNLLXGAAXJXCFOOTCWITRHAJMIJUGUKIRLRBTYQFPEOZGOJYHHIOPTBJHKHJZTNENDTZSISQOWLUDTQFTODSOXEHMDRTBRRDTDKPFUTMMVDHZUOREOXVPOWUKDCFRBXINLBUDSJWVJZSFVMXPDAJTWPABMLMMSRKNKWKZRNJPIZVTVOXXGBSAZUTCMFFMOWKKILFQAIHPEXXGOMBWUOHIIKRFKJYBRUCMLQERNSYTKCXGFPYRTJSGLYEDWYCUZHNHAKZNBDILMCCCKSGVLEXUIZXWAKGAQKLWOJCCBEJHFHFDNWVNLJYMCVOHKBZELEXADGTIQSYRQASSHCUXVULOFAIRGGJMFMCHZMGZIKOGPNWTPHNVZEEHNAAZZOJIBXGPOCWEPZSLVGXVAFEXXQMKSQFIIXAQDBTYUHZFULUYKTISBQKTUZSIBWYCKPDNWZIOVGIWGUTWXOMUGSILLCCKIHQJGSDAVNSLEXNQQRPEXQPPVWPKQNXSZGEZKVBLUKSTRZOUDLERCUPNXGFPAECUTANMTSVNCBAJGPHFNVAQTZSWUSQFOKANNKFKMFVGZQKPHPYEHKDKZRVSBALRYKGYVFCJPWKRWZIBLHYTSTJFYLVJRTBXQYUGLETVEUTGIWOMZVBUFVPOPONKJMIWBDPSYHQURZEBKXDPCJXMLUTWZXHMKHRKURFVORAYCFOFUDCVGNOZLNDGCMQNLFTMHDGHBRNMVASWZWBPXGSGTQAXEMYNJDZTXZNJPKERBIOTWSSBIMMIEXJBOBIZSAFHHAERBUCVQIPJTJSHJEKEKRZZXTFKHRELLTYKWJDKCGIXMIYBSNXINSGKKXURLAVOLVBCOPOAFCSGJBVLNZWDAY

虚饰

每一个框设置一个Id属性,然后在js中用document.getElementById() //例子: var view = document.getElementById('View');获取目标对象然后用其属性innerHEMT来获取属性
打开App,查看更多内容
随时随地看视频慕课网APP

相关分类

JavaScript