mirror of
https://github.com/fluencelabs/wasm-bindgen
synced 2025-07-31 20:11:55 +00:00
Add unit test for HtmlSelectElement binding. (#598)
This commit is contained in:
committed by
Alex Crichton
parent
26a3e57536
commit
c1f182cca7
@@ -38,6 +38,19 @@ export function new_script() {
|
||||
return document.createElement("script");
|
||||
}
|
||||
|
||||
export function new_select_with_food_opts() {
|
||||
let select = document.createElement("select");
|
||||
let opts = ["tomato", "potato", "orange", "apple"];
|
||||
|
||||
for(let i = 0; i < opts.length; i++) {
|
||||
let opt = document.createElement("option");
|
||||
opt.value = opts[i];
|
||||
opt.text = opts[i];
|
||||
select.appendChild(opt);
|
||||
}
|
||||
return select;
|
||||
}
|
||||
|
||||
export function new_span() {
|
||||
return document.createElement("span");
|
||||
}
|
||||
|
Reference in New Issue
Block a user