Sunday, May 19, 2024
 Popular · Latest · Hot · Upcoming
164
rated 0 times [  168] [ 4]  / answers: 1 / hits: 94180  / 15 Years ago, thu, july 9, 2009, 12:00:00

I have a <select> list, which has been populated with several options, but want to remove those options to start again.



I am using jQuery and have tried the following:



$(#selectId).length = 0;


But this seems to have no effect.



Part of my problem is that I am using Firebug to debug the JavaScript, but the debugger does not break at the breakpoint, so I cannot see what is going on. Should it break when the JavaScript is within the <head> of my HTML file?


More From » jquery

 Answers
11

this would do:



$('#selectId').html('');

[#99153] Tuesday, July 7, 2009, 15 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
jacklynr

Total Points: 542
Total Questions: 120
Total Answers: 95

Location: Cape Verde
Member since Fri, Nov 27, 2020
4 Years ago
;