Skip to content

Commit

Permalink
created a submission
Browse files Browse the repository at this point in the history
  • Loading branch information
debayudh2001 committed Feb 1, 2025
1 parent 06ebaf8 commit 1696e77
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
2 changes: 1 addition & 1 deletion main.html
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
<option>Red</option>
<option>Green</option>
<option>White</option>
<option>Black</option>
<option>Black</option>
</select>
<input type="button" value="Select and Remove">
</form>
Expand Down
13 changes: 13 additions & 0 deletions script.js
Original file line number Diff line number Diff line change
@@ -1 +1,14 @@
//your JS code here. If required.
let btn = document.querySelector("input")
let sel = document.querySelector("#colorSelect")
let opts = document.querySelectorAll("option")
btn.addEventListener("click", () => {
//console.log("Clicked")
for(let v of opts){
if(sel.value == v.innerText){
sel.removeChild(v)
break
}
}
})

0 comments on commit 1696e77

Please sign in to comment.