remove() function not working in javascript -
I have the html selection box and a search field (input type)
when I search for something The new, javascript function first clears the selectfield.
But JavaScript returns the following error:
The gs.options.remove function is not
This function is < / P> and gs = What's going wrong? function blank (theft) (for {var i = gs.options.length; i & gt; = 0; i--) {gs.options.remove (i); }}
& lt; Select value style = "width: 420px; height: 150px;" Name = "selection box" size = "5" & gt;
I think there is no selection box reference in your example "GS".
All options are being removed
Remove the functionAlloption (selection box) {var i; (I = selectbox.options.length-1; i> = 0; i--) {selectbox.remove (i); }}
Removing selected option
Delete function option (selection box) {var i; (I = selectbox.options.length-1; i> = 0; i--) {if (selectbox.options [i] .selected) selectbox.remove (i); }}
Comments
Post a Comment